<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Aug 22, 2008 at 5:39 PM, Holger Hoffstätte <span dir="ltr"><<a href="mailto:holger@wizards.de">holger@wizards.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 8/22/08, Ben Hood <<a href="mailto:0x6e6562@gmail.com">0x6e6562@gmail.com</a>> wrote:<br>
> > 2. Is there a way to notify clients like B and C that there is a message<br>
> > for them in one of their queues? Or do you have to poll the queue to find<br>
> > out if there is something for you? (Basically this is a question of using a<br>
> > interrupt like thing vs polling.)<br>
><br>
> If a client subscribes to a queue, the channel will deliver messages<br>
> to it as and when they are routed, so there is no need to poll<br>
> explicitly. If for some reason you need to poll, there is a method<br>
> called basic.get which allows you to poll a queue.<br>
><br>
> BTW, are you asking this question in the context of the API of a MOM<br>
> system that you have used in the past?<br>
<br>
</div>I was wondering the same - to me it sounds like he might be looking<br>
for the equivalent of a JMS MessageListener (with delivery in a thread<br>
pool etc.) and I don't think that's something the Java client lib can<br>
do right now.<br>
Torben, can you clarify what language you are planning to use and<br>
whether this is what you meant with "polling vs. interrupt"?<br>
<br>
Holger<br>
</blockquote></div><br>My plan is to use Erlang for the consumers since they have to deal with a very concise protocol so pattern matching and bit strings is just what the doctor ordered!<br><br>The specific behaviour I am looking for is that when a message arrives in a queue that a consumer is tied to that message will be sent to the consumer directly (this is what I meant by interrupt-like) instead of having to program the consumer to look in the queue for a message ever so often to see if there is something for it (this is what I meant by polling).<br>
<br>The reason I am asking this is two-fold:<br><ol><li>Polling with most likely slow down the system if I have a lot of consumers looking for a message ever so often. This will be bad since some of the message scenarios has the contraint that all members in a group must be able to receive data on a separate medium within 500 ms. This constraint applies to all sizes of our system - even nationwide systems - so time should not be wasted anywhere.</li>
<li>I have just completed a project in Erlang where I was forced to set up a polling mechanism to get messages from an embedded server running on a communications card we had to use. I hated and still hate that solution since the polling is a fix to a problem that fits a more interrupt-like behaviour a lot better. </li>
</ol>Hope this makes my constraints and desired solution a bit clearer.<br><br>Cheers,<br>Torben<br><br></div>