Hi all,
I am using on linux the qpid-proton cpp 0.34 library, coupled to activemq 5.16
on Debian 11
I don't understand why the code who using session object (or default_session)
to send or a receive message, when I try to close it (for example, the
receiver), it's 2 times more important than using a connection and each time
open a receiver od sender and close it?
Here the code who take 2 times more for a close
m_connection.work_queue().add([=]() {
m_connection.default_session().open_receiver("queue://myAdress",
proton::receiver_options().auto_accept(true));
});
........
// The close session
m_receiver.session().close()
// 2 seconds later
on_session_close(proton::session&)
{
cout << "inside on_session_close << endl ;
}
// This code is 2 times more faster
m_connection.work_queue().add([=]() {
m_connection.open_receiver(address,
proton::receiver_options().auto_accept(true));
});
........
m_receiver.close();
// Arounds milli seconds after
on_receiver_close(proton::receiver&)
{
cout << "inside on_receiver_close << endl ;
}
In the broker 's literature and theirs clients, the best way is obtain a
connection, use it to open session, and use the session to send or receive
message, don't open/close a connection every time who want to send/receive a
message.
So it's my question about this performance issue.
Xavier Millieret
Software Engineer
Engineering Software & Connectivity
Power Quality and Electronics Division (PQED)
Immeuble Viseo - Bâtiment A
110, rue Blaise Pascal
38330 Montbonnot St Martin
FRANCE
tel: +33 (0) 4 76 00 66 02
[email protected]<mailto:[email protected]>
www.eaton.com<http://www.eaton.com/>
________________________________
Eaton Industries (France) S.A.S ~ Siège social: 110 Rue Blaise Pascal, Immeuble
Le Viséo - Bâtiment A Innovallée, 38330, Montbonnot-St.-Martin, France ~ Lieu
d'enregistrement au registre du commerce: Grenoble ~ Numéro d'enregistrement:
509 653 176 ~ Capital social souscrit et liberé:EUR 16215441 ~ Numéro de TVA:
FR47509653176
________________________________