Thanks Robert.
I'll try that.
Is there any document where I can understand the two approaches for QPID
Java implmentation (JMS vs. Java)?
I really don't know which path to take. where can I have more details about
it?

Please correct me if I'm wrong: If I adopt the JMS approach, I'll have
richer api and more stable implemtation?
So what's the point of QPID team to maintain 2 "packages"?

Please advise.

dakash



On Thu, May 15, 2008 at 10:14 AM, Robert Greig <[EMAIL PROTECTED]>
wrote:

> 2008/5/15 Daniel Cohen-Sason <[EMAIL PROTECTED]>:
>
> > In C++, the "SubscriptionManager" allow me to subscribe a listener to
> > several queues -
> >
> > This gives my client the flexibility to dynamically receive messages from
> > several queues ["dynamic" because I can dynamically decide, during the
> > listener generation, to which queues to "listen"]
> >
> > Is there an equivalent mechanism here?  [In Java]
> > dakash
>
> Yes, you can do this in Java (i.e. JMS) - but do correct me if I have
> missed something in your requirement.
>
> You can implement the javax.jms.MessageListener and register it with
> however many javax.jms.MessageConsumers you have (you have one
> consumer per destination).
>
> So:
>
> MessageListener myListener = createMessageListener(...);
> session  = connection.createSession(false,  Session.AUTO_ACKNOWLEDGE);
> for (Destination d : destinations)
> {
>    MesssageConsumer conssumer = session.createConsumer(d);
>    consumer.setMessageListener(myListener);
> }
>
> connection.start();
>
> I hope that is what you were looking to do.
>
> RG
>



-- 
Regards,
Daniel Cohen-Sason

Reply via email to