You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by indrayani <in...@gmail.com> on 2013/06/18 13:53:39 UTC

Re: Activemq consumer is closing

Hello,
can you explain what is the actual solution you applied in order to avoid
this exception.
I am facing the same issue and I really need a help.





--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734294.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by boday <be...@initekconsulting.com>.
we set the idleTimeout to 0 in the PooledConnectionFactory config like
this...

    <bean id="pooledConnectionFactoryAdmin"
class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start"
destroy-method="stop">
            <property name="connectionFactory"
ref="jmsConnectionFactoryAdmin" />
            *<property name="idleTimeout" value="0" />*
    </bean>



-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5790930.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I suggest to ask on the ActiveMQ user mailing list.

On Fri, Dec 2, 2016 at 7:29 AM, nitinaggarwal
<i-...@irdeto.com> wrote:
> Hi,
>
> I am using apache-activemq-5.14.1 and getting the below issue.
>
> javax.jms.IllegalStateException: The Consumer is closed
>         at
> org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:880)
>         at
> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:678)
>         at
> org.apache.activemq.jms.pool.PooledMessageConsumer.receiveNoWait(PooledMessageConsumer.java:72)
>         at
> com.irdeto.manager.endpoint.activemq.MessageConsumerManager$2.run(MessageConsumerManager.java:105)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
>
>
> Can you please tell how did you resolved it or in which file did you make
> the change.
>
> Thanks in advance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5790912.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Activemq consumer is closing

Posted by nitinaggarwal <i-...@irdeto.com>.
Hi,

I am using apache-activemq-5.14.1 and getting the below issue.

javax.jms.IllegalStateException: The Consumer is closed
        at
org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:880)
        at
org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:678)
        at
org.apache.activemq.jms.pool.PooledMessageConsumer.receiveNoWait(PooledMessageConsumer.java:72)
        at
com.irdeto.manager.endpoint.activemq.MessageConsumerManager$2.run(MessageConsumerManager.java:105)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)


Can you please tell how did you resolved it or in which file did you make
the change.

Thanks in advance



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5790912.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by indrayani <in...@gmail.com>.
hi all,
i set the property as follows 

<property name="idleTimeout" value="0" />

and now i not facing any exception. 

thank you everybody for the support



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734530.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by indrayani <in...@gmail.com>.
i tried but still i am getting the exceptions



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734411.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by kiranreddykasa <ki...@fss.co.in>.
can U try setting  "replyToType"=Exclusive and "replyTo"=anyqueue

 



-----
Regards

kiran Reddy
--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734366.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by kiranreddykasa <ki...@fss.co.in>.
Hi 

We have created activemq consumer with property autostartup = false. So the
queue wasn't created and it while it was trying to write to the queue (which
doesn't exist) we got that exception.

Once we changed that autostartup = true , it was fine.




-----
Regards

kiran Reddy
--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734330.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by Christian Posta <ch...@gmail.com>.
You should post your connection pool and JmsComponent settings. Are you
using transactions? Are you caching your consumers?


On Thu, Jun 20, 2013 at 2:54 AM, indrayani <in...@gmail.com> wrote:

> below is the full stack trace
>
>
> 2013-06-20 12:24:25,656 [yManager[inbox]] WARN  TemporaryQueueReplyManager
> - Exception inside the DMLC for Temporary ReplyTo Queue for destination
> inbox, refreshing ReplyTo destination
> javax.jms.IllegalStateException: The Consumer is closed
>         at
>
> org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:817)
>         at
>
> org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:581)
>         at
>
> org.apache.activemq.pool.PooledMessageConsumer.receive(PooledMessageConsumer.java:67)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:431)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:311)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
>         at java.lang.Thread.run(Thread.java:662)
> 2013-06-20 12:24:25,656 [yManager[inbox]] WARN
> ultJmsMessageListenerContainer - Setup of JMS message listener invoker
> failed for destination 'temporary' - trying to recover. Cause: The Consumer
> is closed
> 2013-06-20 12:24:25,656 [yManager[inbox]] INFO  PooledConnection
> - failed to delete Temporary Queue
> "temp-queue://ID:xyz-b4be0c20ddf-2115-1371710223718-3:4:1" on closing
> pooled
> connection: The connection is already closed
> 2013-06-20 12:24:25,656 [mer[rtadsinbox]] WARN
> ultJmsMessageListenerContainer - Setup of JMS message listener invoker
> failed for destination 'rtadsinbox' - trying to recover. Cause: The
> Consumer
> is closed
> 2013-06-20 12:24:25,671 [Consumer[inbox]] WARN
> ultJmsMessageListenerContainer - Setup of JMS message listener invoker
> failed for destination 'inbox' - trying to recover. Cause: The Session is
> closed
> 2013-06-20 12:24:25,671 [.0.1:2117@61616] WARN  Transport
> - Transport Connection to: tcp://127.0.0.1:2117 failed:
> java.io.EOFException
> 2013-06-20 12:24:25,687 [Consumer[inbox]] INFO
> ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
> 2013-06-20 12:24:25,703 [mer[rtadsinbox]] INFO
> ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
> 2013-06-20 12:24:25,703 [yManager[inbox]] INFO
> ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
> 2013-06-20 12:24:25,703 [yManager[inbox]] WARN  TemporaryQueueReplyManager
> - Exception inside the DMLC for Temporary ReplyTo Queue for destination
> inbox, refreshing ReplyTo destination
> javax.jms.IllegalStateException: The Session is closed
>         at
> org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:731)
>         at
> org.apache.activemq.ActiveMQSession.getTransacted(ActiveMQSession.java:521)
>         at
>
> org.apache.activemq.pool.PooledSession.getTransacted(PooledSession.java:259)
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:573)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:359)
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
>         at java.lang.Thread.run(Thread.java:662)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734413.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Activemq consumer is closing

Posted by indrayani <in...@gmail.com>.
below is the full stack trace


2013-06-20 12:24:25,656 [yManager[inbox]] WARN  TemporaryQueueReplyManager    
- Exception inside the DMLC for Temporary ReplyTo Queue for destination
inbox, refreshing ReplyTo destination
javax.jms.IllegalStateException: The Consumer is closed
	at
org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:817)
	at
org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:581)
	at
org.apache.activemq.pool.PooledMessageConsumer.receive(PooledMessageConsumer.java:67)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:431)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:311)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
	at java.lang.Thread.run(Thread.java:662)
2013-06-20 12:24:25,656 [yManager[inbox]] WARN 
ultJmsMessageListenerContainer - Setup of JMS message listener invoker
failed for destination 'temporary' - trying to recover. Cause: The Consumer
is closed
2013-06-20 12:24:25,656 [yManager[inbox]] INFO  PooledConnection              
- failed to delete Temporary Queue
"temp-queue://ID:xyz-b4be0c20ddf-2115-1371710223718-3:4:1" on closing pooled
connection: The connection is already closed
2013-06-20 12:24:25,656 [mer[rtadsinbox]] WARN 
ultJmsMessageListenerContainer - Setup of JMS message listener invoker
failed for destination 'rtadsinbox' - trying to recover. Cause: The Consumer
is closed
2013-06-20 12:24:25,671 [Consumer[inbox]] WARN 
ultJmsMessageListenerContainer - Setup of JMS message listener invoker
failed for destination 'inbox' - trying to recover. Cause: The Session is
closed
2013-06-20 12:24:25,671 [.0.1:2117@61616] WARN  Transport                     
- Transport Connection to: tcp://127.0.0.1:2117 failed: java.io.EOFException
2013-06-20 12:24:25,687 [Consumer[inbox]] INFO 
ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
2013-06-20 12:24:25,703 [mer[rtadsinbox]] INFO 
ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
2013-06-20 12:24:25,703 [yManager[inbox]] INFO 
ultJmsMessageListenerContainer - Successfully refreshed JMS Connection
2013-06-20 12:24:25,703 [yManager[inbox]] WARN  TemporaryQueueReplyManager    
- Exception inside the DMLC for Temporary ReplyTo Queue for destination
inbox, refreshing ReplyTo destination
javax.jms.IllegalStateException: The Session is closed
	at
org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:731)
	at
org.apache.activemq.ActiveMQSession.getTransacted(ActiveMQSession.java:521)
	at
org.apache.activemq.pool.PooledSession.getTransacted(PooledSession.java:259)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:573)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:359)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
	at java.lang.Thread.run(Thread.java:662)



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734413.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by Christian Müller <ch...@gmail.com>.
The consumer for which which queue was closed? Can you share the complete
stack trace?

Best,

Christian Müller
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Jun 19, 2013 at 9:18 AM, indrayani <in...@gmail.com> wrote:

> hi,
> thanks for the quick reply.
>
> actually my scenario is little different , I am not creating any consumer
> on
> camel side. I have just defined routes .
> if you have some time, then can you please check the following scenario.
> what is happening is, first and second time communication works fine, but
> for the third time I am getting
> consumer closed and session closed exceptions.
> It would be really helpful if you check the following scenario and help me
> out .
> ------------------------------------------------
>
> the communication is happening between two applications deployed on tomcat
> via camel applicaiton which is also deployed on tomcat.
>
>
> camel routes are as follows :
>
>   public void configure() {
>       from("servlet:///servletA")
>             .process(new Processor() {
>
>                                 @Override
>                                 public void process(Exchange exchange)
> throws Exception {
>                                         System.out.println("*** from
> servletA to activemq inbox");
>
>                                 }
>                         })
>                         .to("activemq:queue:inbox");
>
>       from("activemq:queue:inbox")
>         .setHeader(Exchange.HTTP_METHOD, constant("POST"))
>         .process(new Processor() {
>
>                         @Override
>                         public void process(Exchange exchange) throws
> Exception {
>                                 System.out.println("*** from activemq inbox
> to applicationB");
>
>                         }
>                 })
>                 .to
> ("http://localhost:8082/applicationB/a.do?bridgeEndpoint=true")
>                 .process(new Processor() {
>
>                         @Override
>                         public void process(Exchange exchange) throws
> Exception {
>                                 System.out.println("*** from applicationB
> back to the caller that is servletA");
>                                 exchange.getOut().setHeader("JOB_NO",
> exchange.getIn().getHeader("JOB_NO"));
>                         }
>                 });
>
>
>       from("servlet:///servletC")
>       .process(new Processor() {
>
>                         @Override
>                         public void process(Exchange exchange) throws
> Exception {
>                                 System.out.println("*** from servletC to
> activemq inboxD");
>
>                         }
>                 })
>                 .to("activemq:queue:inboxD");
>
>       from("activemq:queue:inboxD")
>       .setHeader(Exchange.HTTP_METHOD, constant("POST"))
>       .process(new Processor() {
>
>                         @Override
>                         public void process(Exchange exchange) throws
> Exception {
>                                 System.out.println("*** from activemq
> inboxD
> to applicationE");
>                         }
>                 })
>
> .to(ExchangePattern.InOnly,"
> http://localhost:8082/applicationE/agentResp?bridgeEndpoint=true");
>
>     }
>
> Please let me know if you need any more details.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734337.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Activemq consumer is closing

Posted by indrayani <in...@gmail.com>.
hi,
thanks for the quick reply.

actually my scenario is little different , I am not creating any consumer on
camel side. I have just defined routes . 
if you have some time, then can you please check the following scenario.
what is happening is, first and second time communication works fine, but
for the third time I am getting 
consumer closed and session closed exceptions.
It would be really helpful if you check the following scenario and help me
out .
------------------------------------------------

the communication is happening between two applications deployed on tomcat
via camel applicaiton which is also deployed on tomcat. 


camel routes are as follows :

  public void configure() { 
      from("servlet:///servletA") 
            .process(new Processor() { 
                                
                                @Override 
                                public void process(Exchange exchange)
throws Exception { 
                                        System.out.println("*** from
servletA to activemq inbox"); 
                                        
                                } 
                        }) 
                        .to("activemq:queue:inbox"); 
      
      from("activemq:queue:inbox") 
        .setHeader(Exchange.HTTP_METHOD, constant("POST")) 
        .process(new Processor() { 
                        
                        @Override 
                        public void process(Exchange exchange) throws
Exception { 
                                System.out.println("*** from activemq inbox
to applicationB"); 
                                
                        } 
                }) 
                .to
("http://localhost:8082/applicationB/a.do?bridgeEndpoint=true") 
                .process(new Processor() { 
                        
                        @Override 
                        public void process(Exchange exchange) throws
Exception { 
                                System.out.println("*** from applicationB 
back to the caller that is servletA"); 
                                exchange.getOut().setHeader("JOB_NO",
exchange.getIn().getHeader("JOB_NO")); 
                        } 
                }); 
      
    
      from("servlet:///servletC") 
      .process(new Processor() { 
                        
                        @Override 
                        public void process(Exchange exchange) throws
Exception { 
                                System.out.println("*** from servletC to
activemq inboxD"); 
                                
                        } 
                }) 
                .to("activemq:queue:inboxD"); 
                
      from("activemq:queue:inboxD") 
      .setHeader(Exchange.HTTP_METHOD, constant("POST")) 
      .process(new Processor() { 
                        
                        @Override 
                        public void process(Exchange exchange) throws
Exception { 
                                System.out.println("*** from activemq inboxD
to applicationE"); 
                        } 
                }) 
               
.to(ExchangePattern.InOnly,"http://localhost:8082/applicationE/agentResp?bridgeEndpoint=true"); 
    
    } 

Please let me know if you need any more details.



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734337.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by indrayani <in...@gmail.com>.
I am facing the same " consumer closed issue " that ' kiranreddykasa ' was
facing and from her post what i found was she has got the solution of
autostart, so just wanted to know how did she apply that solution.
in which xml she did changes.



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq consumer is closing

Posted by Christian Müller <ch...@gmail.com>.
There is not enough input that we can start digging into it...

http://camel.apache.org/support.html

Best,
Christian

Sent from a mobile device
Am 18.06.2013 14:01 schrieb "indrayani" <in...@gmail.com>:

> Hello,
> can you explain what is the actual solution you applied in order to avoid
> this exception.
> I am facing the same issue and I really need a help.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734294.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>