Hi,

I tried the same example (after changing the contextfactory) with ActiveMQ
(version 5.15.8) and the main program does not exit. That is the reason I
expected the same behavior from ActiveMQ Artemis. If that is not defined in
the JMS spec I will follow other ways you have suggested to prevent the
program from exiting.

Thank you for the clarification.

Regards,
Riyafa

On Thu, 21 Feb 2019 at 21:42, michael.andre.pearce
<michael.andre.pea...@me.com.invalid> wrote:

> 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



-- 
Riyafa Abdul Hameed
Graduate, University of Moratuwa

Email: riyafa...@cse.mrt.ac.lk
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf>  <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>

Reply via email to