Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 40150 invoked from network); 13 Aug 2010 12:31:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Aug 2010 12:31:25 -0000 Received: (qmail 72630 invoked by uid 500); 13 Aug 2010 12:31:25 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 72455 invoked by uid 500); 13 Aug 2010 12:31:23 -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 72444 invoked by uid 99); 13 Aug 2010 12:31:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Aug 2010 12:31:21 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qy0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Aug 2010 12:31:15 +0000 Received: by qyk29 with SMTP id 29so821902qyk.2 for ; Fri, 13 Aug 2010 05:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=D8JXI0mkhUzdUMRCdbkfRYBxvSzsUZZ0LHsjXIxXjqk=; b=ZdmcaIvyCOQLXN/gs0/mbnDX9VY23MfhAat40m681QoKG70WDp1UFzqtDR+icfpY8/ ZorHTudYkuxOTJm1MRxMCIhDioTN/TiDr0PQFNXBAK7urIoqdjAxUbXDw7D0G/6xIsGm hrbeVoxig464YzZH/ZR7jWZM1nsGQyKRjsEi4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uwGGbtEJKBnc1mpXMwkbSvQgpiuE3G4FNoHd44L+rTDcdaewWFrlzJaI2cbTel/bOO WwUIlGKNCUm4o6ungf1rQIoKmgoNR+R9rL8Sw8A2ww3dPIUB5aJ2OJTBYxnD+cYvC7Ah vNG5IVEmYnZdYpebOR5Mw2plmwbCa0BnJiTtU= MIME-Version: 1.0 Received: by 10.224.88.69 with SMTP id z5mr910918qal.359.1281702654736; Fri, 13 Aug 2010 05:30:54 -0700 (PDT) Received: by 10.229.71.223 with HTTP; Fri, 13 Aug 2010 05:30:54 -0700 (PDT) In-Reply-To: <29427831.post@talk.nabble.com> References: <29427831.post@talk.nabble.com> Date: Fri, 13 Aug 2010 13:30:54 +0100 Message-ID: Subject: Re: How to forward a full message received in Java by onMessage() into another queue? From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org you need a message producer and do producer.send(..., message); On 13 August 2010 12:40, BenXS wrote: > > Assume I wrote a Java bean (configured by Spring) which receives successf= ully > incoming messages on a certain queue. So the "onMessage()" method looks > similar like: > > public void onMessage(Message message) { > =A0 ... > =A0 } > > Now I want to forward/sent the just received message into another queue > "bbbqueue" on the > same MessageBroker. > > Yes, I know, this can be done much easier by tools like Camel but my > described scenario above > is a much simplfied version of a complex application. So I have/want to u= se > a java bean for this. > > I just want to know how to put an already prepared message into another > queue with a MINIMUM of overhead. > Keep in mind that the FULL JMS message should be forwarded. That means th= e > actual payload body AND > all the JMS header (properties). > > It must be something similar to: > > public void onMessage(Message message) { > =A0 ... > =A0 this.send("bbbqueue", message); > =A0 } > > Unfortuenately the code above does not work. > How else can I code this? > > Ben > -- > View this message in context: http://old.nabble.com/How-to-forward-a-full= -message-received-in-Java-by-onMessage%28%29-into-another-queue--tp29427831= p29427831.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > --=20 http://blog.garytully.com Open Source Integration http://fusesource.com