You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by ricardlf <ri...@dsic.upv.es> on 2009/09/29 10:34:48 UTC

How can I know queue existence?

Hi!
I'm working on an application where each consumer has its own queue, the
producers wait until the queue of its consumer is created and then they
start to send message to its consumer (the producer knows the consumer's
queue name from the begining). How can I know when the queue is created to
make the producer start to send messages? I need to do this in Java and C++
because I'm wraiting producers in both languages.
Thank you.

Ricard
-- 
View this message in context: http://n2.nabble.com/How-can-I-know-queue-existence-tp3734626p3734626.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: How can I know queue existence?

Posted by Gordon Sim <gs...@redhat.com>.
On 09/29/2009 11:09 AM, ricardlf wrote:
>
> Hi!
> Maybe it's a solution for this paricular case. But I can imagine other
> situations where there would be necessary to know if a queue exists or
> not, for example, what if the consumer disconnects from the broker and
> the producer has still some messages to send? in this case, all those
> messages will fail, so, is there a method or function to know the
> existence of a queue?

In AMQP 0-10 you can use either queue-query or exchange-bound to 
determine the existence of a queue without destroying the session if it 
does not exist (queue-declare with the passive flag set will also detect 
presence, but if the queue doesn't exist the session used is destroyed).

In the c++ client this would involve e.g.

session.queueQuery(arg::queue="my-queue").getQueue() == "my-queue"

or

!session.exchangeBound(arg::exchange="amq.direct", 
arg::queue="my-queue").getQueueNotFound()

It would not be possible via JMS. You could also use QMF (Qpid 
Management Framework) to get this information (assuming you are using 
the c++ broker).

> Thank you very much!
>
> El mar, 29-09-2009 a las 02:11 -0700, Gordon Sim (via Nabble) escribió:
>> On 09/29/2009 09:34 AM, ricardlf wrote:
>>>
>>> Hi!
>>> I'm working on an application where each consumer has its own queue,
>> the
>>> producers wait until the queue of its consumer is created and then
>> they
>>> start to send message to its consumer (the producer knows the
>> consumer's
>>> queue name from the begining). How can I know when the queue is
>> created to
>>> make the producer start to send messages? I need to do this in Java
>> and C++
>>> because I'm wraiting producers in both languages.
>>
>> My suggestion would be to have the consumer send (or broadcast) a
>> message when they are ready to receive messages.
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:[hidden email]
>>
>>
>>
>>
>> ______________________________________________________________________
>> View message @
>> http://n2.nabble.com/How-can-I-know-queue-existence-tp3734626p3734825.html
>> To unsubscribe from How can I know queue existence?, click here.
>>
>
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: How can I know queue existence?

Posted by ricardlf <ri...@dsic.upv.es>.
Hi!
Maybe it's a solution for this paricular case. But I can imagine other
situations where there would be necessary to know if a queue exists or
not, for example, what if the consumer disconnects from the broker and
the producer has still some messages to send? in this case, all those
messages will fail, so, is there a method or function to know the
existence of a queue?
Thank you very much!

El mar, 29-09-2009 a las 02:11 -0700, Gordon Sim (via Nabble) escribió:
> On 09/29/2009 09:34 AM, ricardlf wrote: 
> > 
> > Hi! 
> > I'm working on an application where each consumer has its own queue,
> the 
> > producers wait until the queue of its consumer is created and then
> they 
> > start to send message to its consumer (the producer knows the
> consumer's 
> > queue name from the begining). How can I know when the queue is
> created to 
> > make the producer start to send messages? I need to do this in Java
> and C++ 
> > because I'm wraiting producers in both languages. 
> 
> My suggestion would be to have the consumer send (or broadcast) a 
> message when they are ready to receive messages. 
> 
> --------------------------------------------------------------------- 
> Apache Qpid - AMQP Messaging Implementation 
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[hidden email] 
> 
> 
> 
> 
> ______________________________________________________________________
> View message @
> http://n2.nabble.com/How-can-I-know-queue-existence-tp3734626p3734825.html 
> To unsubscribe from How can I know queue existence?, click here.
> 


-- 
View this message in context: http://n2.nabble.com/How-can-I-know-queue-existence-tp3734626p3735107.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

Re: How can I know queue existence?

Posted by Gordon Sim <gs...@redhat.com>.
On 09/29/2009 09:34 AM, ricardlf wrote:
>
> Hi!
> I'm working on an application where each consumer has its own queue, the
> producers wait until the queue of its consumer is created and then they
> start to send message to its consumer (the producer knows the consumer's
> queue name from the begining). How can I know when the queue is created to
> make the producer start to send messages? I need to do this in Java and C++
> because I'm wraiting producers in both languages.

My suggestion would be to have the consumer send (or broadcast) a 
message when they are ready to receive messages.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org