ActiveMQ - how to deal with producer is closed -
the following code creates consumer , registers queue:
pooledconnectionfactory factory = new pooledconnectionfactory(broker_url); connection connection = factory.createconnection(); session session = connection.createsession(false, session.auto_acknowledge); destination destqueue = new activemqqueue(queue); producer producer = session.createproducer(destqueue);
the problem 'producer closed' exception:
javax.jms.illegalstateexception: producer closed @ org.apache.activemq.activemqmessageproducer.checkclosed(activemqmessageproducer.java:196) @ org.apache.activemq.activemqmessageproducer.getdestination(activemqmessageproducer.java:153) @ org.apache.activemq.jms.pool.pooledproducer.<init>(pooledproducer.java:43) @ org.apache.activemq.jms.pool.pooledsession.createproducer(pooledsession.java:361)
restarting application reestablishes connection , messages drained correctly. there way check if producer has been closed , refresh connection?
Comments
Post a Comment