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 016A5200BD1 for ; Mon, 28 Nov 2016 17:36:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F2FAF160B0D; Mon, 28 Nov 2016 16:36:25 +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 47011160B00 for ; Mon, 28 Nov 2016 17:36:25 +0100 (CET) Received: (qmail 23635 invoked by uid 500); 28 Nov 2016 16:36:24 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 23617 invoked by uid 99); 28 Nov 2016 16:36:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2016 16:36:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0E601C0FD4 for ; Mon, 28 Nov 2016 16:36:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.5 X-Spam-Level: ** X-Spam-Status: No, score=2.5 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=pronoia-solutions-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id dH-NtNo2J5Jj for ; Mon, 28 Nov 2016 16:36:20 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7569C5FBD6 for ; Mon, 28 Nov 2016 16:36:20 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id c21so231542237ioj.1 for ; Mon, 28 Nov 2016 08:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pronoia-solutions-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=YUc7obuEAhhVbWagi7XjPX5OPf4ze0kQmqesWgo9Nio=; b=XKfG/WttLRea23cASRTu69Ml7PVIZQ7HZOW70Dc9RSt12+sNTs0+mTQR50ODZJ0Lmf sQChcDmRPj/vK6bKeN7YGBV5UzNgk+RQIfGSQBecpD+ZxonpD0EJzbeoR5oEoGY8L4Ec YjrEPv7J6zQ6EkqEivS2WmJWnVIb0Hxu1Euo2euXr9YOksh35Bt0czu42twBgub4nC+Q bfvLWcG1ZNig2CMNhz6dGw9lOTLFzwHq1YkN+rA8aGEIW0xFbV2IBfMqdR9Hjarwyzr0 6WQpMk/aU5CkF/QEs/Eh34hNZzrA4EIKOTTaXabltImtdbHpAU3VGXZoCP7/Yixd/l4r DbnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=YUc7obuEAhhVbWagi7XjPX5OPf4ze0kQmqesWgo9Nio=; b=XcaPpWBilYsnfgv39zbpZ39FEnrsPpT12GmshNJcnEKuOPr5Ia2W74xITFv0W3wvif u2OepH/1L9GoPE2vwhIx9HdRjHFO2jQhfKbiEaTN+iPTYVvUs8vq6FqKDIvOmxp0Nl5J 6g9w/U2QAGFEjAqgqiP9RcPKr9KtB8EvZiDUKzzgmAfqc6hXR8STlvtlM+82pcZ7JFgH sg/lNPHKNv7ufwrz0M237xZD1pXl/98MyYC37A8Bm8o/baEvUyWG67fyNA4yj2UV6MgJ EWQTiGM5ZMrisTudhqVyu/p3Y1eYrjw4kVsCja52+YGIYZQGlZ8IQkVxiiyXpMNbrvp9 J/mg== X-Gm-Message-State: AKaTC03Y4syM6+TPcQXMUjuGseJnzOMpAfkMZmBsjpV+/YzV/CDbyn5TJXsS8Rcqff1euQ== X-Received: by 10.107.195.204 with SMTP id t195mr17930839iof.46.1480350958831; Mon, 28 Nov 2016 08:35:58 -0800 (PST) Received: from macpro.pronoia.local (c-24-10-239-245.hsd1.ut.comcast.net. [24.10.239.245]) by smtp.gmail.com with ESMTPSA id p77sm20159564iod.35.2016.11.28.08.35.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 08:35:58 -0800 (PST) From: Quinn Stevenson Content-Type: multipart/alternative; boundary="Apple-Mail=_0714FD37-D20E-4793-94B0-90CCC990D3A8" Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: How to use the InOut (Request-Reply) pattern in combination with REST/Jetty? Date: Mon, 28 Nov 2016 09:35:57 -0700 References: <583821AC.7080205@fau.de> <583BE1F6.8030301@fau.de> To: users@camel.apache.org In-Reply-To: <583BE1F6.8030301@fau.de> Message-Id: <74AAD8A5-B797-456B-8D21-CEC02F2E7A52@pronoia-solutions.com> X-Mailer: Apple Mail (2.3251) archived-at: Mon, 28 Nov 2016 16:36:26 -0000 --Apple-Mail=_0714FD37-D20E-4793-94B0-90CCC990D3A8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Yes - this is possible. Look at "Request-Reply=E2=80=9D in the JMS docs = ( http://camel.apache.org/jms.html ). > On Nov 28, 2016, at 12:51 AM, Frank Wein wrote: >=20 > Hi all, > some additional info/Java code: What I have currently working is some = code without the ActiveMQ part: >=20 > restConfiguration().component("jetty").host("0.0.0.0").port(8080) > .dataFormatProperty("prettyPrint", "true") > .bindingMode(RestBindingMode.auto); >=20 > rest("/API/").get("/object/{ID}/").to("direct:objectGet"); >=20 > from("direct:objectGet") > .setExchangePattern(ExchangePattern.InOut) > .setHeader(Exchange.HTTP_PATH, simple( > "/Webservice/RESTService/Object/${header.ID}")) > .setHeader(Exchange.HTTP_METHOD, simple("GET")) > .to("jetty://http://localhost:8888?bridgeEndpoint=3Dtrue"); >=20 > I send my REST request to localhost:8080/object/[ID]/ and get back the = reply from the other webservice running on localhost:8888. >=20 > Now, I want to include an ActiveMQ queue here. Basically the ActiveMQ = queue should be between the two routes (from/to("direct:objectGet")). = The first route should send the message to the queue, the second route = should fetch it, get the response from the other web service and send = the response back via the queue to the first route. This one should then = reply to the incoming REST request. Is this possible, if yes, how? My = attempts at this did not really work. >=20 > Regards > Frank >=20 >=20 > Frank Wein wrote: >> Hi all, >> I have a problem setting up the correct Camel routes in Java for a = problem I'm having. I'm still quite new to Camel and ActiveMQ, so please = be patient with me :) >>=20 >> What I want to accomplish is the following: >> * Provide a REST (HTTP GET) endpoint with Camel (Jetty) and send the = request (message) to an ActiveMQ queue (the ActiveMQ queue is a = requirement, probably would be easier without) >> * Consume the message (with a second route?), take some of the = parameters from the HTTP URL (so message properties) and send a = HTTP/REST request to another REST service. >> * Take the response from the other REST service and send it back to = the REST client (from the beginning) >=20 >=20 > --=20 > Frank Wein > Forschungsgruppe Netz > Friedrich-Alexander-Universitaet Erlangen-Nuernberg > Regionales Rechenzentrum Erlangen (RRZE) > Martensstrasse 1, 91058 Erlangen, Germany > Tel. +49 9131/85-29983, Fax +49 9131/302941 > frank.wein@fau.de > www.rrze.fau.de >=20 >=20 --Apple-Mail=_0714FD37-D20E-4793-94B0-90CCC990D3A8--