Hi,

I check out the source code from SVN trunk, build java qpid-0.15 broker.
I meet some problems about how to manage connection and sessions.

My Code:

                Connection connection = this.getConnection();
                Session session = null;
                try {
                        session = connection.createSession(false,
                                        Session.AUTO_ACKNOWLEDGE);
                        AMQAnyDestination dest = new AMQAnyDestination(new 
AMQShortString(
                                        "amq.topic"), new 
AMQShortString("topic"),
                                        new AMQShortString(routingKey), false, 
false,
                                        new AMQShortString(routingKey), true, 
null);

                        MessageProducer messageProducer = 
session.createProducer(dest);
                        ObjectMessage message = 
session.createObjectMessage(objectMessage);
                        messageProducer.send(message);
                        messageProducer.close();
                        session.close();
                } catch (JMSException e) {
                        logger.warn("sendTopicMessage failed." + e);
                } finally {
                        forceClose(session);
                }

The getConnection() method always return the same connection object, i only
close the session here. 
I run these code more then 100 times, I got the following exceptions.

1.ERROR [taskExecutor-2][2011-12-01
18:22:44,749][org.apache.qpid.client.AMQConnection]: Throwable Received but
no listener set: org.apache.qpid.AMQException: timed out waiting for sync:
complete = 2, point = 3 [error code 541: internal error]

2.receive failed.javax.jms.JMSException: Error registering consumer:

3.receive failed.javax.jms.IllegalStateException: Object AMQConnection:

thanks for your advice..

-Di






--
View this message in context: 
http://apache-qpid-users.2158936.n2.nabble.com/Connection-and-session-management-tp7050173p7050173.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to