<div class="gmail_quote">On Fri, Dec 9, 2011 at 17:13, Michael Klishin <span dir="ltr"><<a href="mailto:michael.s.klishin@gmail.com">michael.s.klishin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Le 09/dic/2011 à 19:41, Busoli, Simone a écrit :<br>
<div class="im"><br>
> I'm dealing with this by having a single channel with one consumer which consumes from all the queues the application needs to read data from. What kind of limitation do you see in keeping it single threaded?<br>
><br>
<br>
</div>I think it's fine for many cases, however, I am designing a solution that library will use and there are definitely problems that can be naturally split into many concurrent tasks.<br>
<br>
Currently both Langohr and Hot Bunnies use an executor (basically, submit message handlers to a thread pool) which is single threaded by default but can be swapped with any other. So my thinking is influenced by this scenario, probably too much.<br>
</blockquote><div><br></div><div>I'm not familiar with the executor you mention, but with "submit message handlers to a thread pool" what do you mean exactly? What I mentioned above is just how the library consumes messages from rabbit, how it marshals them to the application code is a different matter. Currently I'm doing the marshaling in the same thread as that which consumes from the rabbit queue, which has the disadvantage of being as blocking as the application code which consumes the message, but also the advantage of being able to intercept exceptions being thrown by the application consuming the message and thus enable policies to retry the consume, for instance. Anyway I'm not sure I understand what you specifically refer to and I'be glad if you could expand as it is something interesting for me too, as I didn't take much time to look into how other libraries are handling that.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
>> 3. How do I detect that reconnection has succeeded?<br>
><br>
> In the .NET client when you Open the connection and no exception is thrown I think you can safely assume that the connection has been established.<br>
<br>
</div>This is true for the Java client, too. Does this mean that you open all channels in one place in the code? (I find this is a good idea)<br></blockquote><div><br></div><div>I actually have an IPublishingModule and an IComsumingModule, which are independent of each other. They both subscribe to events fired by a ReliableConnection class I implemented which takes care of spotting connection issues and schedule reconnection the broker when it shuts down, notifying observers about these events. The modules carry out what is sensible for them in response to connection status events. For instance the publishing module stops trying to publish and enqueues publishes requested by the application code (which is thus unaware, to a certain extent, of the temporary connection failure), and then as soon as the connection is restored recreates the channel and resumes publishing. On the other hand the consuming module will just stop receiving and will recreate the amqp entities when the connection is restored.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im HOEnZb"><br>
MK<br>
<br>
<a href="http://github.com/michaelklishin" target="_blank">http://github.com/michaelklishin</a><br>
<a href="http://twitter.com/michaelklishin" target="_blank">http://twitter.com/michaelklishin</a><br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br>