On Thu, 2015-10-22 at 22:20 +0300, Michael Ivanov wrote: > Thanks for the advice, > > I am using messenger in passive mode integrating it into select > -driven > event loop. Mayxbe reactor would be more appropriate, but I have > checked > the proton api documentation and al reactor functions are regrettably > uncommented. > > Where can I find c++ examples? >
Funny you should say that, I want to write a C++ example of select integration exactly because I feel the reactor approach is over complicated (and as you say undocumented.) If you haven't already, check out the proton C++ binding, which should be part of the next release. http://qpid.apache.org/releases/qpid-proton-master/proton/cpp/api/index .html Currently the binding is reactor based with everything controlled from the Container::run() method. My proposal is to add an alternative method of starting connections to the Container which returns a simple bytes-in/bytes-out API that can be driven from select or any IO framework. Almost all of the user code would be identical to what is already shown in the C++ examples - user-implemented event handlers. The only difference would be that instead of driving everything in a single thread from the Container's run() method, each connection can be driven independently (and concurrently) by your IO framework. I'll try to get something out in the next few days. Cheers, Alan. > Best regards, > > > 22.10.2015 21:36, aconway пишет: > > On Thu, 2015-10-22 at 18:20 +0300, Michael Ivanov wrote: > > > Hallo, > > > > > > What kind of communication error recovery is available in proton > > > library (if at all)? > > > I am using proton messenger in passive mode and I noticed very > > > unpleasant behaviour: > > > wherever the connection to qpidd is broken (eg. when qpidd is > > > restarted), the client > > > progan does not seem to get any notification about that, it just > > > proceeds to run, but > > > does not get any messages from the queue anymore. Sasme behaviour > > > is > > > observed when > > > proton messenger just listens for incoming messages directly: > > > wherever the receiver > > > program is restarted the sender is not notified and the messages > > > are > > > just get lost. > > > Is there any way to get a notifications about connection state > > > change > > > or should I use > > > a tracker for each message to test whether the message was > > > delivered > > > successfully? > > > As far as I understand the trackers mechanism I can use them only > > > to > > > poll for the > > > status of messages being sent? And if the messages are excluded > > > from > > > pni_store between > > > polling then I might still loose the information about message > > > delivery result? > > > > > > Please help me to sort this out. > > > > > > Best regards, > > > > Much of the focus on proton has moved away from messenger towards > > an > > event-driven approach using the reactor. That approach gives you > > full > > visibility of pretty much all protocol events including > > connection/link/session close, disconnect etc. You might want to > > take a > > look. The programming style is quite different from messenger but > > gives > > you much greater control. There are good examples and a tutorial in > > python and C++, I haven't looked at the C documentation recently. > > > > Cheers, > > Alan. > > > > ------------------------------------------------------------------- > > -- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
