You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Mark Soderquist <So...@ldschurch.org> on 2015/12/18 00:43:10 UTC

Qpid JMS client able to send but not receive

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.soderquist@ldschurch.org<ma...@ldschurch.org>
801-240-9288


Re: Qpid JMS client able to send but not receive

Posted by Mark Soderquist <So...@ldschurch.org>.
That was it. Simple error.



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-JMS-client-able-to-send-but-not-receive-tp7635452p7635454.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Qpid JMS client able to send but not receive

Posted by Timothy Bish <ta...@gmail.com>.
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.soderquist@ldschurch.org<ma...@ldschurch.org>
> 801-240-9288
>
>


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org