activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mayuraviraj <>
Subject Re: Identify ActiveMQ asyncrhonous message failures?
Date Fri, 19 Feb 2016 07:35:32 GMT
While I was analysing how activemq do it async send internally I found
following approach to get async response. ( This is using activemq producer
implementation). Unfortunately i had to abandon PooledConnectionFactory
since PooledConnection does not have a way to return ActiveMQMessageProducer
( it has method with protected access). However I believe even-though
following code using only once connection since sessions are created in
separate thread, performance won't be impacted. 

ActiveMQConnectionFactory factory = new
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProduer producer = session.createProducer(destination);
Queue queue = session.createQueue(qName);
((ActiveMQMessageProducer)producer).send(queue, message, new AsyncCallback()
        public void onSuccess() {


        public void onException(JMSException exception) {


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message