Cause: The queue binding for a previous subscription is still present in the destination object.
Consequence: This causes a Queue-Not-Found exception when trying to create the new subscription (and the old subscription queue is not there anymore).
Fix: Queue binding for the subscription queue is issued explicitly instead of adding into the list of bindings.
Result: You could now create multiple Topic subscriptions with the same destination without any errors.
DescriptionRajith Attapattu
2012-01-26 22:51:58 UTC
Description of problem:
If a Topic destination is used with another consumer a binding for the previous subscriber still exists. This is due to the code adding it to the binding list, but not removing it.
If the consumer finishes the subscription and this queue is deleted, then an exception will be thrown when a subsequent consumer tries to use this destination to create a subscriptions.
A solution to this problem is to issue the binding explicitly for the subscription queue and not add it to the bindings list.
Version-Release number of selected component (if applicable):
java rpms that support addressing.
How reproducible:
Always
Steps to Reproduce:
AMQConnection con = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'");
con.start();
Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE);
Destination d = ssn.createTopic("amq.topic/test");
MessageConsumer cons1 = ssn.createConsumer(d);
cons1.close();
((AMQSession_0_10)ssn).sendQueueDelete(((AMQDestination)d).getAMQQueueName());
((AMQSession_0_10)ssn).sync();
MessageConsumer cons2 = ssn.createConsumer(d);
Actual results:
Exception thrown. Ex,
Exception in thread "main" javax.jms.JMSException: Error registering consumer: org.apache.qpid.AMQException: ch=0 id=3 ExecutionException(errorCode=NOT_FOUND, commandId=15, classCode=7, commandCode=4, fieldIndex=0, description=not-found: Bind failed. No such queue: TempQueue63977b9c-0dd1-4159-b65a-fe388b035024 (qpid/broker/Broker.cpp:1041), errorInfo={}) [error code 404: not found]
at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2079)
Expected results:
The subscription should succeed.
Additional info:
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Cause: The queue binding for a previous subscription is still present in the destination object.
Consequence: This causes a Queue-Not-Found exception when trying to create the new subscription (and the old subscription queue is not there anymore).
Fix: Queue binding for the subscription queue is issued explicitly instead of adding into the list of bindings.
Result: You could now create multiple Topic subscriptions with the same destination without any errors.
Description of problem: If a Topic destination is used with another consumer a binding for the previous subscriber still exists. This is due to the code adding it to the binding list, but not removing it. If the consumer finishes the subscription and this queue is deleted, then an exception will be thrown when a subsequent consumer tries to use this destination to create a subscriptions. A solution to this problem is to issue the binding explicitly for the subscription queue and not add it to the bindings list. Version-Release number of selected component (if applicable): java rpms that support addressing. How reproducible: Always Steps to Reproduce: AMQConnection con = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'"); con.start(); Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); Destination d = ssn.createTopic("amq.topic/test"); MessageConsumer cons1 = ssn.createConsumer(d); cons1.close(); ((AMQSession_0_10)ssn).sendQueueDelete(((AMQDestination)d).getAMQQueueName()); ((AMQSession_0_10)ssn).sync(); MessageConsumer cons2 = ssn.createConsumer(d); Actual results: Exception thrown. Ex, Exception in thread "main" javax.jms.JMSException: Error registering consumer: org.apache.qpid.AMQException: ch=0 id=3 ExecutionException(errorCode=NOT_FOUND, commandId=15, classCode=7, commandCode=4, fieldIndex=0, description=not-found: Bind failed. No such queue: TempQueue63977b9c-0dd1-4159-b65a-fe388b035024 (qpid/broker/Broker.cpp:1041), errorInfo={}) [error code 404: not found] at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2079) Expected results: The subscription should succeed. Additional info: