JMS Consumer hangs on shutdown (ActiveMQ)

I have a webapp deployed on JBoss which connects to an external JMS broker (ActiveMQ 5.15.4) using 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 (and container) is continuing.

A thread dump reveals the following information:

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

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.