activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vale80 <>
Subject javax.jms.IllegalStateException: The producer is closed
Date Fri, 17 Jul 2009 13:21:58 GMT

Hi all,
I am experiencing  the exception “javax.jms.IllegalStateException: The
producer is closed” when I try to publish a new message  in the queue.
I should put in the queue a new message every 10 minutes   (or with an even
lower frequency ) but after the first one, sometimes after a couple of
messages, I got the exception  written above.

Is there any inactivity timeout I have to set on the producer? 

Helps are really appreciated.

best regards


This is the code I use to init the queque and to insert messages in it.

public void init(String topicName) throws JSSException {
    try {
      ActiveMQConnectionFactory factory = new
      connection = factory.createConnection();
      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      topic = session.createTopic(topicName);
      publisher = session.createProducer(topic);
      om = session.createObjectMessage();
    } catch(Exception ex) {

public void publish(Object msg) throws JSSException {
try {
      publisher.send(om, javax.jms.DeliveryMode.NON_PERSISTENT,
    } catch(Exception ex) {

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

View raw message