activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <>
Subject Re: JMS Asynchronous Receiver for ActiveMQ Artemis
Date Fri, 22 Feb 2019 03:31:33 GMT
On 2/21/19 10:24 PM, Justin Bertram wrote:
> I looked at the code for the javax.jms.Connection implementation in
> ActiveMQ 5 and it wasn't clear to me what would have been blocking in the
> call to start(). Artemis supports the OpenWire protocol so you can still
> use the 5.x client. If you use the 5.x client with Artemis does it block?
> I'd be curious to see a thread dump from the client when it's blocking as
> you describe.

The start method doesn't block but the ActiveMQ 5.x client lot many 
other JMS clients I'm aware of does keep a single non-daemon thread 
running at all times or order to do what the user is asking.  Qpid JMS 
does that same but is configurable to not do as, and I think I recall 
there being a configuration option in 5.x as well.  So what is happening 
is that the JVM isn't shutting down because of this, the receiver will 
keep on getting messages until it closes the connection.

> Justin
> On Thu, Feb 21, 2019 at 8:37 PM Riyafa Abdul Hameed <>
> wrote:
>> 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
>> <> 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 <
>>>> Date: 21/02/2019  14:06  (GMT+00:00) To:
>>> Subject: JMS Asynchronous Receiver for
>> ActiveMQ
>>> Artemis Hi,I have the following asynchronous receiver for ActiveMQ
>> Artemis:
>>> 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:
>> Website: <>
>> <>  <>
>> <>

Tim Bish

View raw message