From users-return-50985-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Fri Feb 22 03:24:59 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 05C2018064C for ; Fri, 22 Feb 2019 04:24:58 +0100 (CET) Received: (qmail 78604 invoked by uid 500); 22 Feb 2019 03:24:52 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 78592 invoked by uid 99); 22 Feb 2019 03:24:52 -0000 Received: from mail-relay.apache.org (HELO mailrelay2-lw-us.apache.org) (207.244.88.137) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2019 03:24:52 +0000 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mailrelay2-lw-us.apache.org (ASF Mail Server at mailrelay2-lw-us.apache.org) with ESMTPSA id A91073133 for ; Fri, 22 Feb 2019 03:24:51 +0000 (UTC) Received: by mail-ot1-f54.google.com with SMTP id m1so744838otf.5 for ; Thu, 21 Feb 2019 19:24:51 -0800 (PST) X-Gm-Message-State: AHQUAuaaEQNKJFwL/Q0ChtrKQGendHzZMgscqX2tkZndwUtd6NJZXyli tqM0WWIzyqDDn5dX0ANVTBHSzJsYqbi1C3FeczGmUg== X-Google-Smtp-Source: AHgI3IYYjz9k8lTMkX1CjiCJKzUq6Dv5NZLJHRAC/lITSn+AyMZt6Pe2J4Qq3/Hx/BQWHzk3KrxjCCIRFCMZMGueNA8= X-Received: by 2002:a9d:328a:: with SMTP id u10mr1278206otb.336.1550805891122; Thu, 21 Feb 2019 19:24:51 -0800 (PST) MIME-Version: 1.0 References: <5c6ecde8.1c69fb81.573e5.c6beSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: From: Justin Bertram Date: Thu, 21 Feb 2019 21:24:24 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: JMS Asynchronous Receiver for ActiveMQ Artemis To: users@activemq.apache.org Content-Type: multipart/alternative; boundary="00000000000041a85d058273222f" --00000000000041a85d058273222f Content-Type: text/plain; charset="UTF-8" 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. 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 < > > riyafa@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.12@cse.mrt.ac.lk > Website: https://riyafa.wordpress.com/ > > > --00000000000041a85d058273222f--