Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 3291 invoked from network); 16 Sep 2009 06:13:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 06:13:46 -0000 Received: (qmail 8840 invoked by uid 500); 16 Sep 2009 06:13:46 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 8773 invoked by uid 500); 16 Sep 2009 06:13:45 -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 8763 invoked by uid 99); 16 Sep 2009 06:13:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 06:13:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 06:13:33 +0000 Received: by fxm12 with SMTP id 12so3257705fxm.20 for ; Tue, 15 Sep 2009 23:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=o+LcOxYKooZ/g1elemmmU2hNdluwH7ga+WEfRNPwrCo=; b=O1OvGv1/JE2DOpJq+tFG6i/+BqPz+g7PirEws+tUyyAIzNGBNmDiJDQ+ofwMtEe9mh Yq7ZqwAv0m6VHrmgoO+GVNu4x2QdnFAUkeGqi78YvW1jzcCE2QtUZ9D0KBOOCMlI1hOj qVnNP9sD+xQaPPSX22+u6r0aFOOcSczed7V7c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=aBRII6e0qy2MKv3+2Umom4sB7DPcKswGzXUeacdFihgWyBF5/eeuQaMXW6d/LdGwEp tqrmKE/xM75EBUlOl3FKRo3VVegu8/XsDqiy3xmkZjk/kloXKJQtUI3EjUD/OVAk3FWN 5rvqtRDl+WKWk83MY7x1Nu4ISRsgx7Qfsc2lw= MIME-Version: 1.0 Received: by 10.204.156.205 with SMTP id y13mr7049162bkw.116.1253081593186; Tue, 15 Sep 2009 23:13:13 -0700 (PDT) In-Reply-To: <25466487.post@talk.nabble.com> References: <25453382.post@talk.nabble.com> <5380c69c0909150558r51ab75b0v128051a0ff9c58dc@mail.gmail.com> <25466487.post@talk.nabble.com> From: Claus Ibsen Date: Wed, 16 Sep 2009 08:12:53 +0200 Message-ID: <5380c69c0909152312h6b5e950er1614c90f4412a141@mail.gmail.com> Subject: Re: Bootstrapping camel from MDB To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Sep 16, 2009 at 8:07 AM, marcuse wrote: > > Yes it is a real EJB MDB > > So I just set up my camel context & ProducerTemplate in the MDB constructor > and then in the onMessage method i do > producerTemplate.sendBody("whatever",theJmsMessage); ? Yeah pretty much. As you are not using the camel-jms to receive the JMS message it have not done its bidning from JMS world to Java world which means that extraating JMS body, and JMS properties cannot be done automatic by Camel. Which may require you to do that manually if you need them. // for example to extract the jms as a text message String text = ((TextMessage) message).getText(); producerTemplate.sendBody("whatever", text); However Camel also have its type converter mechanism which may support this out of the box. I gotta check the source to be sure. As you are the first with that must use MDB. > > /Marcus > > > > Claus Ibsen-2 wrote: >> >> On Tue, Sep 15, 2009 at 2:49 PM, marcuse wrote: >>> >>> Hi >>> >>> I have a project which uses MDBs, and I want to try using camel for >>> routing >>> incoming messages to various message handlers, googling showed me >>> http://camel.apache.org/maven/camel-jms/apidocs/org/apache/camel/component/jms/CamelMessageListener.html >>> but this seems removed from camel 2.0. >>> >>> Also looked at the source for CamelMessageListener to reproduce the >>> functionality, but I did not get by the fact that JmsExchange was removed >>> >>> So, my question is, what is the best practise for using camel from an >>> MDB? >>> >> >> You are using real EJB MDB, if I understand you correctly? >> >> And then you want in the onMessage(Message msg) method to route the >> message with Camel? >> >> You can take a look at this example: >> http://camel.apache.org/walk-through-an-example.html >> >> Where you can setup Camel manually in the MDB and then use it to route >> the message. >> >> >> Camel itself can of course also listen to JMS queues, in case you not >> need to use MDB. >> >> >>> /Marcus >>> -- >>> View this message in context: >>> http://www.nabble.com/Bootstrapping-camel-from-MDB-tp25453382p25453382.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- > View this message in context: http://www.nabble.com/Bootstrapping-camel-from-MDB-tp25453382p25466487.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus