Rajith Attapattu wrote:
On Wed, Mar 11, 2009 at 12:47 PM, ffrenchm <[email protected]> wrote:
Hello,

If I want to send message on non existing queue "Q1" without any consumer on
this queue, I notice that no queue "Q1" are created. I would like to know :

1) why queue are created when creating JMS consumer and not JMS producer ?
The JMS producer does not create and bind any queues.

I think the question is, why?

I can understand that the producer for a Topic would ignore the declaration of queues or bindings while the corresponding consumer would create the queue and bind it.

For a Queue though I think the current behaviour is unintuitive. If the queue is created on demand when consuming from it, I would expect the same to happen when producing to it.

2) where are pushed the messages sended by my sender ? Is there a dead
letter queue in QPID ? Why do I not have an exception which tell me the
queue doesn't exist ?

I think a much better and simpler solution here would be to declare the queue on creating a producer for the Queue instance, optionally setting the passive flag if we don't want auto-created queues. The same would work for creating a consumer for that Queue.

That way you can either have create-on-demand queues that work whether you happen to try to publish or consume first, or you can fail fast with an exception when you try to produce or consume to a non-existent queue in the event that you expect these to have been preconfigured.

To me that would be more intuitive.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to