You need to call connection.start() in order to begin processing of incoming messages when dealing with JMS connections.
On 12/17/2015 06:43 PM, Mark Soderquist wrote: > I have implemented a simple client with the qpid-jms-client 0.6.0 client > against Qpid 6.0.0 Java Broker. I have successfully been able to send > messages but I am unable to consume messages. Everything works without error > and I know that I am connecting because I see the consumer create events on > the server, however, no messages arrive. I used the qpid-amqp-1-0-client-jms > 0.32 client and was able to receive messages so at this point I believe it is > either user error or a bug in qpid-jms-client. Here is my code to retrieve a > message in the event I'm missing something obvious. > > Connection connection = null; > Session session = null; > MessageConsumer consumer = null; > EmxMessage emxMessage = null; > > String uri = "amqps://" + host + ":" + port + "?jms.username=" + > username + "&jms.password=" + password + "&amqp.vhost=default"; > ConnectionFactory factory = new JmsConnectionFactory( uri ); > > try { > connection = factory.createConnection(); > session = connection.createSession( false, > Session.AUTO_ACKNOWLEDGE ); > consumer = session.createConsumer( new JmsQueue( queue ) ); > > Message message = consumer.receive( 2000 ); > } > catch( Exception exception ) { > logger.error( "Error receiving message.", exception ); > } > > This is the client output: > > [AmqpProvider:(1):[amqps://emx-test.ldschurch.org:5671]] INFO > org.apache.qpid.jms.sasl.SaslMechanismFinder - Best match for SASL auth was: > SASL-PLAIN > [AmqpProvider:(1):[amqps://emx-test.ldschurch.org:5671]] INFO > org.apache.qpid.jms.JmsConnection - Connection > ID:sandstone-53917-1450393363128-0:1 connected to remote Broker: > amqps://emx-test.ldschurch.org:5671 > > Any ideas? > > --- > Mark Soderquist > Engineering Manager | Enterprise Integration > The Church of Jesus Christ of Latter-Day Saints > mark.soderqu...@ldschurch.org<mailto:mark.soderqu...@ldschurch.org> > 801-240-9288 > > -- Tim Bish twitter: @tabish121 blog: http://timbish.blogspot.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org