Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 77685 invoked from network); 29 Sep 2008 14:43:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Sep 2008 14:43:57 -0000 Received: (qmail 50436 invoked by uid 500); 29 Sep 2008 14:43:56 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 50405 invoked by uid 500); 29 Sep 2008 14:43:55 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 50394 invoked by uid 99); 29 Sep 2008 14:43:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 07:43:55 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 74.125.46.153 as permitted sender) Received: from [74.125.46.153] (HELO yw-out-1718.google.com) (74.125.46.153) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 14:42:53 +0000 Received: by yw-out-1718.google.com with SMTP id 6so300545ywa.86 for ; Mon, 29 Sep 2008 07:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=4+/7M3W1le6ebPnuD6jWBW01TcRczY8gAB2wxS++EcU=; b=YKHYKpdLHqK/BywQr6lMXO9GdSdzsUE1sUnxP005s4sgdXFSgGCeBxLv0OU0CBEO4m gclh7pJxRNCfjvHL0RAFPqXREAyWHwieB0933+Q7dRGlWZljjTzRrsDN940mrAeVxV6O Zs/XyaogsjRNLqmUM+i+CjfR99FFSvJX1EFBU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Z3cejznc837f+wDvWJcwECN5PheY/oep/xtwgcNlNDKv/K5hljy7EVLeoju118o1I8 ms8NZu4LOOVKydZrSHmvX4PPiRhyT86pzYri8sebstwNhW6ezce2Vknzok/t7BXE37En oN5hKLFdfLyMH82GaNPk1nH/ZDR4+qYCQVW5w= Received: by 10.90.103.3 with SMTP id a3mr5735682agc.5.1222699389537; Mon, 29 Sep 2008 07:43:09 -0700 (PDT) Received: by 10.90.117.12 with HTTP; Mon, 29 Sep 2008 07:43:09 -0700 (PDT) Message-ID: Date: Mon, 29 Sep 2008 15:43:09 +0100 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: Using ExchangePattern.InOut blocks request queue In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19701558.post@talk.nabble.com> <48DED6AA.4020803@gmail.com> <19724861.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 2008/9/29 James Strachan : > 2008/9/29 ee7arh : >> >> Hi Willem, >> >> Thanks for your answer. >> >> I've actually solved the issue now using Spring Remoting but will explain in >> more detail my original dilema since it took us a lot of hardwork and >> searching to "stumble upon" the solution ;) >> >> Perhaps I should first clarify that what I was trying to achieve was to >> replace RMI with Camel [using JMS underneath] within my application. I had a >> multi threaded client application one 1 side which sent requests to an RMI >> server application on the other side. Standard client/server stuff, sort of >> like a WebServer where requests are in effect able to be processed by the >> server in parallel (although each request is atomic). >> >> So instead of starting up an RMI server, I replaced this with Camel. My >> routes were configured something like this: >> >> from("jms:queue:myqueue").to("bean:requestProcessor?methodName=processRequest"); >> >> In my former RMI "Impl" class which actually did the service processing on >> the server side, instead of extending UnicastRemoteObject, I now just added >> the following annotation at the top of the class: >> >> @Service(value = "requestProcessor") >> >> And within that class I had a method called "processRequest()". >> >> The behaviour I wanted was that whenever a client thread wanted the server >> to process a service request, it would use the ExchangePattern.InOut when >> calling sendBody() like so: >> >> myResponseObject = (MyResponse)camelTemplate.sendBody("jms:queue:myqueue", >> ExchangePattern.InOut, myReqObject); >> >> This seemed to work fine but I noticed that the server would process only 1 >> client request at a time. I guess this is because there is actually only a >> single consumer on the server side reading off the underlying JMS queue. > > Yeah - you can enable more concurrent processing of the requests by > configuring your JMS component - or via the URI > > See > > http://activemq.apache.org/camel/jms.html > > e.g. > > from("jms:queue:myqueue?concurrentConsumers=50").to("bean:requestProcessor?methodName=processRequest"); I've added this to the FAQ http://cwiki.apache.org/CAMEL/why-does-my-jms-route-only-consume-one-message-at-once.html -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com