The newer Address syntax you are using for your destination was only implemented in the client for use with AMQP 0-10, and as such isnt currently supported when using the client with AMQP 0-9-1. You seem to have hit a codepath which doesnt throw and exception directly saying that.
If you want to use 0-9-1 you will need to make use of the BindingURL format for creating your destination objects, described at: https://cwiki.apache.org/qpid/bindingurlformat.html The client expects Address syntax usage by default, you can prompt use of BindingURLs either through changing the default by setting the qpid.dest_syntax system property to "BURL", or by prefixing each destination String with "BURL:" Robbie On 17 April 2012 05:11, Hasitha Abeykoon <[email protected]> wrote: > Hi, > > When I was writing a JMS client for Qpid I set > System.setProperty(ClientProperties.AMQP_VERSION, "0-91"); > > I create my queue as following > initialContextProperties.put("destination.testQueue102", "testQueue102; > {create:always}"); > > I was trying to publish a message to qpid queue and read it back from the > queue. > When I run following exception occurs. > > org.apache.qpid.client.JMSAMQException: Queue bound query failed: Attempt > to redeclare exchange: null of type direct to null. > at > org.apache.qpid.client.AMQSession_0_8.isQueueBound(AMQSession_0_8.java:301) > at > org.apache.qpid.client.BasicMessageProducer.isBound(BasicMessageProducer.java:599) > at > org.apache.qpid.client.QueueSenderAdapter.checkQueuePreConditions(QueueSenderAdapter.java:210) > at > org.apache.qpid.client.QueueSenderAdapter.send(QueueSenderAdapter.java:53) > at NewSendClient.sendMessage(NewSendClient.java:56) > at NewSendClient.main(NewSendClient.java:14) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) > Caused by: org.apache.qpid.client.AMQAuthenticationException: Attempt to > redeclare exchange: null of type direct to null. [error code 530: not > allowed] > at > org.apache.qpid.client.handler.ConnectionCloseMethodHandler.methodReceived(ConnectionCloseMethodHandler.java:80) > at > org.apache.qpid.client.handler.ClientMethodDispatcherImpl.dispatchConnectionClose(ClientMethodDispatcherImpl.java:192) > at > org.apache.qpid.framing.amqp_0_91.ConnectionCloseBodyImpl.execute(ConnectionCloseBodyImpl.java:140) > at > org.apache.qpid.client.state.AMQStateManager.methodReceived(AMQStateManager.java:112) > at > org.apache.qpid.client.protocol.AMQProtocolHandler.methodBodyReceived(AMQProtocolHandler.java:536) > at > org.apache.qpid.client.protocol.AMQProtocolSession.methodFrameReceived(AMQProtocolSession.java:458) > at > org.apache.qpid.framing.AMQMethodBodyImpl.handle(AMQMethodBodyImpl.java:93) > at > org.apache.qpid.client.protocol.AMQProtocolHandler$2.run(AMQProtocolHandler.java:487) > at org.apache.qpid.pool.Job.processAll(Job.java:110) > at org.apache.qpid.pool.Job.run(Job.java:149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > > > What I am missing here? Is there a special way with VERSION, "0-91" because > everything works fine when I comment out > System.setProperty(ClientProperties.AMQP_VERSION, "0-91"); > > Thanks. > > -- > *Hasitha Abeykoon,* > *Department of Computer Science & Engineering,* > *University of Moratuwa. * > * > * > *Skype: foreverhasitha* --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
