Webapp shutdown hangs on JMS Consumer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Webapp shutdown hangs on JMS Consumer

Mauro de Wit
Hi all,

I have a webapp deployed on JBoss which connects to an external JMS broker
(ActiveMQ 5.15.4) using the the ActiveMQ resource adapter 5.15.4. The webapp
cannot be undeployed or shutdown because the ActiveMQMessageConsumer blocks.
(The entire JBoss container cannot even stop). Only when the broker is
shutdown, the webapp shutdown is continuing.

A thread dump reveals te following information:

   java.lang.Thread.State: TIMED_WAITING (on object monitor) at
java.lang.Object.wait(Native Method) at
org.apache.activemq.FifoMessageDispatchChannel.dequeue(FifoMessageDispatchChannel.java:74)
- locked <0x000000008bc1a1a8> (a java.lang.Object) at
org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:486)
at
org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:653)

The queue is being read by a MessageConsumer like:

Message message = this.consumer.receive(1000);

Any suggestions? In the activeMQ sources I saw that a prefetch policy of 0
causes an indefinite wait, but setting this to a higher value had no result.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Webapp shutdown hangs on JMS Consumer

Tim Bain
Are you closing the consumer when your app gets notified that it's shutting
down? If not, why not?

Tim

On Fri, Jul 20, 2018, 8:14 AM Mauro de Wit <[hidden email]> wrote:

> Hi all,
>
> I have a webapp deployed on JBoss which connects to an external JMS broker
> (ActiveMQ 5.15.4) using the the ActiveMQ resource adapter 5.15.4. The
> webapp
> cannot be undeployed or shutdown because the ActiveMQMessageConsumer
> blocks.
> (The entire JBoss container cannot even stop). Only when the broker is
> shutdown, the webapp shutdown is continuing.
>
> A thread dump reveals te following information:
>
>    java.lang.Thread.State: TIMED_WAITING (on object monitor)    at
> java.lang.Object.wait(Native Method)    at
> org.apache.activemq.FifoMessageDispatchChannel.dequeue(FifoMessageDispatchChannel.java:74)
>
> - locked <0x000000008bc1a1a8> (a java.lang.Object)      at
> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:486)
>
> at
>
> org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:653)
>
> The queue is being read by a MessageConsumer like:
>
> Message message = this.consumer.receive(1000);
>
> Any suggestions? In the activeMQ sources I saw that a prefetch policy of 0
> causes an indefinite wait, but setting this to a higher value had no
> result.
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>