RabbitMQ does have an AMQP 1.0 plugin that can be easily enabled. More on the plugins: https://www.rabbitmq.com/plugins.html
I have done some experimenting with the SwiftMQ AMQP 1.0 java driver and it does work with RabbitMQ's AMQP 1.0 plugin. Cheers, Cory -----Original Message----- From: Steve Huston [mailto:shus...@riverace.com] Sent: Wednesday, June 10, 2015 8:16 AM To: users@qpid.apache.org Subject: RE: Connecting to RabbitMQ using QPid client Hi Mansour, > I am a bit confused by the compatibily issues between different > versions of the AMPQ, and lost in the documentation. Sorry about that - hopefully we can help get things straightened out. > First thing, as far as I know, AMQP is not JMS. There's a lot of > examples QPid about JMS, which led me to include that in QPid, JMS is > compatible with AMQP. Is this conclusiong correct ? > Is it documented some where ?? Sort of - JMS is an API spec; AMQP is a protocol spec. The JMS clients supplied by Apache Qpid are compatible with AMQP. > We have two components "QPid Proton" and "QPid JMS". Both are clients > for AMQP. QPid JMS is built on Proton. > Which one do I use ? Neither. Those are both to work with AMQP 1.0. RabbitMQ is AMQP 0.8 (0.9?) so it requires the JMS client that works with older AMQP versions. You can find it here: http://qpid.apache.org/components/jms/amqp-0-x.html > Additionally, I am not sure about what mvn depencies to use with what. > Then comes the URL and the initial factory part. Looking at the > examples, was not a lot of help, as I am testing agains RabbitMQ, and > don't know when I am hitting an issue, if it's compatability or I am doing > something wrong. Hopefully someone else can help with the detailed questions below as I don't have much experience with those. -Steve > Here's the initial factory options we have, > > > java.naming.factory.initial = > org.apache.qpid.jms.jndi.JmsInitialContextFactory > java.naming.factory.initial = > org.apache.qpid.jndi.PropertiesFileInitialContextFactory > java.naming.factory.initial = > org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory > > Then the URL format, > connectionfactory.localhost = > amqp://guest:guest@localhost:5672?clientid=test-client&remote- > host=default > connectionfactory.localhost = amqp://guest:guest@localhost:5672 > connectionfactory.localhost = amqp://localhost:5672 > > I have read these pages, but still lost: > > https://cwiki.apache.org/confluence/display/qpid/AMQP+compatibility > https://www.rabbitmq.com/interoperability.html > > Now, my issue is connecting using QPid client to both RabbitMQ and > QPid broker 0.32 > > I am just doing the simple HelloWord example: > > Here's my jndi: > java.naming.factory.initial = > org.apache.qpid.jms.jndi.JmsInitialContextFactory > connectionfactory.localhost = amqp://localhost:5672 queue.myQueue = > git- repo-name > > maven: > <dependency> > <groupId>org.apache.qpid</groupId> > <artifactId>qpid-jms-client</artifactId> > <version>0.2.0</version> > </dependency> > > Java: > Context context = new InitialContext(); > ConnectionFactory factory = (ConnectionFactory) > context.lookup("localhost"); > Destination queue = (Destination) context.lookup("myQueue"); > Connection connection = factory.createConnection(USER, > PASSWORD); > connection.setExceptionListener(new MyExceptionListener()); > connection.start(); > Session session = connection.createSession(false, > Session.AUTO_ACKNOWLEDGE); > MessageProducer producer = session.createProducer(queue); > > > The error on the client when connecting to QPid: > > 2015-06-10 17:22:04,483 [localhost:5672]] - DEBUG AmqpAbstractResource > - AmqpSession { ID:localhost-48465-1433942523956-0:1:1 } is now > open: > 2015-06-10 17:22:04,488 [localhost:5672]] - DEBUG AmqpSession > - Creating AmqpFixedProducer for: git-repo-name > 2015-06-10 17:22:04,495 [localhost:5672]] - TRACE NettyTcpTransport > - Attempted write of: 253 bytes > 2015-06-10 17:22:07,498 [ntLoopGroup-2-1] - TRACE NettyTcpTransport > - Exception on channel! Channel is [id: 0x6ca00e8f, > /127.0.0.1:44497 => localhost/127.0.0.1:5672] > 2015-06-10 17:22:07,499 [localhost:5672]] - INFO AmqpProvider > - Transport failed: Connection reset by peer > 2015-06-10 17:22:07,500 [ntLoopGroup-2-1] - TRACE NettyTcpTransport > - Channel has gone inactive! Channel is [id: 0x6ca00e8f, > /127.0.0.1:44497 :> localhost/127.0.0.1:5672] Connection > ExceptionListener fired, exiting. > 2015-06-10 17:22:07,501 [localhost:5672]] - DEBUG AmqpProvider > - Transport connection remotely closed > javax.jms.JMSException: Connection reset by peer > at > org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsException > S > upport.java:60) > at > org.apache.qpid.jms.JmsConnection.onAsyncException(JmsConnection.java: > 1169) > at > org.apache.qpid.jms.JmsConnection.onConnectionFailure(JmsConnection.ja > va:1085) > at > org.apache.qpid.jms.provider.amqp.AmqpProvider.fireProviderException(A > mqpProvider.java:832) > at > org.apache.qpid.jms.provider.amqp.AmqpProvider$17.run(AmqpProvider.ja > va:688) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at java.util.concurrent.FutureTask.run(FutureTask.java:262) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.a > c > cess$201(ScheduledThreadPoolExecutor.java:178) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.r > u > n(ScheduledThreadPoolExecutor.java:292) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j > av > a:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. > ja > va:615) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.io.IOException: Connection reset by peer > at sun.nio.ch.FileDispatcherImpl.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) > at sun.nio.ch.IOUtil.read(IOUtil.java:197) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) > at > io.netty.buffer.UnpooledHeapByteBuf.setBytes(UnpooledHeapByteBuf.java > :256) > at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:871) > at > io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChan > nel.java:208) > at > io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstrac > t > NioByteChannel.java:108) > at > io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java: > 494) > at > io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEven > t > Loop.java:461) > at > io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java: > 378) > at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350) > at > io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadE > ven > tExecutor.java:101) > ... 1 more > > > > When connecting to rabbitMQ I am getting this client error: > > 015-06-10 12:04:54,395 [ntLoopGroup-2-1] - TRACE NettyTcpTransport > - Channel has gone inactive! Channel is [id: 0xc1361df3, > /127.0.0.1:36720 :> localhost/127.0.0.1:5672] Connection > ExceptionListener fired, exiting. > 2015-06-10 12:04:54,397 [localhost:5672]] - DEBUG AmqpProvider > - Transport connection remotely closed > javax.jms.JMSException: Connection reset by peer > at > org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsException > S > upport.java:60) > at > org.apache.qpid.jms.JmsConnection.onAsyncException(JmsConnection.java: > 1169) > at > org.apache.qpid.jms.JmsConnection.onConnectionFailure(JmsConnection.ja > va:1085) > at > org.apache.qpid.jms.provider.amqp.AmqpProvider.fireProviderException(A > mqpProvider.java:832) > at > org.apache.qpid.jms.provider.amqp.AmqpProvider$17.run(AmqpProvider.ja > va:688) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at java.util.concurrent.FutureTask.run(FutureTask.java:262) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.a > c > cess$201(ScheduledThreadPoolExecutor.java:178) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.r > u > n(ScheduledThreadPoolExecutor.java:292) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j > av > a:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. > ja > va:615) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.io.IOException: Connection reset by peer > at sun.nio.ch.FileDispatcherImpl.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) > at sun.nio.ch.IOUtil.read(IOUtil.java:197) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) > at > io.netty.buffer.UnpooledHeapByteBuf.setBytes(UnpooledHeapByteBuf.java > :256) > at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:871) > at > io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChan > nel.java:208) > at > io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstrac > t > NioByteChannel.java:108) > at > io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java: > 494) > at > io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEven > t > Loop.java:461) > at > io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java: > 378) > at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350) > at > io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadE > ven > tExecutor.java:101) > ... 1 more > > Please note that with rabbitMq, I am able to connect and send messages > from Python using Pika: > > credentials = pika.PlainCredentials('guest', 'guest') parameters = > pika.ConnectionParameters('localhost' , 5672 , '/' , credentials ) > connection = pika.BlockingConnection( parameters ) channel = > connection.channel() > #channel.queue_declare(queue='git-repo-name') > for line in out.readlines(): > channel.basic_publish(exchange='', routing_key='git-repo-name', > body=line.rstrip() ) > connection.close() > > > Any help is highly appreciated. > > Thank you > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For > additional commands, e-mail: users-h...@qpid.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org