You could use a countdown latch that then when you wish to shutdown you simply 
from another thread countdown.Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: Riyafa Abdul Hameed <riy...@apache.org> 
Date: 21/02/2019  14:06  (GMT+00:00) To: users@activemq.apache.org Subject: JMS 
Asynchronous Receiver for ActiveMQ Artemis Hi,I have the following asynchronous 
receiver for ActiveMQ 
Artemis:https://gist.github.com/riyafa/7b0e5814286c60edb157f9a83fb64765Here 
what I would expect when I call queueConn.start(); is that I want thethread to 
wait to  receive messages. I mean I don't want the main to exitcausing the 
program to shutdown. This is the expected behavior in JMS if Iam not mistaken 
because I noticed this behavior in other brokers.But with JMS in ActiveMQ 
Artemis I don't get the same behavior. The mainprogram exits even though I am 
calling  connection.start(). Is there anyother way that I can use the 
MessageListener and not have the program exitapart from using Thread.sleep?I am 
using artemis client 2.6.3.Thanks,Riyafa

Reply via email to