Thanks Gordon,
I was able to create a Dynamic queue ..
Then I was trying to write a message consumer to consume messages from that
particular queue dynamically created. For the time being I tried both the
publisher code as well as the consumer code in Java,
Here are my code samples..
Sender.java
-----------------
Connection connection = new
AMQConnection("amqp://guest:guest@test/?brokerlist='tcp://localhost:5672'");
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination queue = new AMQAnyDestination("ADDR:sajith_queue_test; {create:
always}");
MessageProducer producer = session.createProducer(queue);
TextMessage message = session.createTextMessage("created234");
producer.send(message);
Receiver.java
------------------
Connection connection = new AMQConnection("amqp://guest:guest@test
/?brokerlist='tcp://localhost:5672'");
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination queue = new AMQAnyDestination("ADDR:sajith_queue_test; {create:
always}");
MessageConsumer consumer = session.createConsumer(queue);
Message message = consumer.receive();
System.out.println("Receieved : " + message);
Here, I'm expecting that receiver will consume the message which was
earlier sent by the Sender, but I don't get any messages printed in
Receiver's side.
I verified in Qpid-management console as well, there I can see that queue
"sajith_queue_test" has been created, and shows following statistics, which
are of relevant
MessageCount : 1
ReceivedMessagCount : 1
ConsumerCount : 1
ActiveConsumerCount : 0
Seems consumer has not been active.. could this be a problem ?
Also, Im confused a bit, that is, in this way I'm sending and receiving
messages directly to the Queue, but not via an Exchange, isn't it?
According to the AMQP spec, as I
understood, we should deal with an Exchange, and based on the bindings only
messages are sent to the particular queues.
Appreciate if you could shed some light in order to get my confusions
sorted out..
Thanks
Sajith
On Wed, Sep 5, 2012 at 12:33 PM, Gordon Sim <[email protected]> wrote:
> On 09/05/2012 07:55 AM, Sajith Kariyawasam wrote:
>
>> Is it possible in Qpid, to create a queues dynamically, make those
>> queues persistent , and let subscribers subscribe to it ?
>>
>
> Yes. You can use an address of the form:
>
> my-queue; {create:always, node:{durable:True}}
>
> This can be used as the address for which you create a receiver in the
> c++/python APIs, and as the configuration for the Destination object for
> which you create a MessageConsumer in JMS.
>
> If you haven't already done so, I would suggest reading
> http://qpid.apache.org/books/**0.18/Programming-In-Apache-**Qpid/html/<http://qpid.apache.org/books/0.18/Programming-In-Apache-Qpid/html/>which
> has some more detail on the other capabilities of addressing.
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail:
> [email protected].**org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>
--
Best Regards
Sajith