Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E42F3200CAF for ; Thu, 22 Jun 2017 14:39:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E2DC8160BE7; Thu, 22 Jun 2017 12:39:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5833C160BE5 for ; Thu, 22 Jun 2017 14:39:06 +0200 (CEST) Received: (qmail 97151 invoked by uid 500); 22 Jun 2017 12:39:05 -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 Delivered-To: moderator for users@activemq.apache.org Received: (qmail 69303 invoked by uid 99); 22 Jun 2017 09:05:13 -0000 X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.488 X-Spam-Level: *** X-Spam-Status: No, score=3.488 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001, URI_HEX=1.313, URI_TRY_3LD=0.001] autolearn=disabled Date: Thu, 22 Jun 2017 01:48:14 -0700 (PDT) From: "klaus.holst.jacobsen" To: users@activemq.apache.org Message-ID: <1498121294854-4727730.post@n4.nabble.com> Subject: CMS 3.9.2 process hangs when calling setMessageListener(..) in onMessage(...) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Thu, 22 Jun 2017 12:39:07 -0000 Hello! I would like to send a request and get a reply from a message handlers onMessage(...) method. Something like this: void MyClass::onMessage(cms::Message m) { cms::Destination* tempDest = session_->createTemporaryQueue(); cms::MessageConsumer* responseConsumer = session_->createConsumer(tempDest); SomeOtherMessageHandler replyHandler; responseConsumer->setMessageListener(&replyHandler); cms::Message* request = session_->createTextMessage(); m->setCMSReplyTo(tempDest); p->send(m); ...wait for response... cms::Message* response = replyHandler.getResponse(); } ...but my code hangs in setMessageListener(...); My guess is that because I am in the onMessage method i have locked a mutex that is required to do setMessageHandler(...) Is this an error or not? In any case, what is the work-around to be able to do request/reply from a message handler? Thanks in advance. Regards Klaus -- View this message in context: http://activemq.2283324.n4.nabble.com/CMS-3-9-2-process-hangs-when-calling-setMessageListener-in-onMessage-tp4727730.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.