Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BEC3D41D for ; Mon, 20 Aug 2012 23:31:47 +0000 (UTC) Received: (qmail 12817 invoked by uid 500); 20 Aug 2012 23:31:47 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 12789 invoked by uid 500); 20 Aug 2012 23:31:47 -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 12781 invoked by uid 99); 20 Aug 2012 23:31:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 23:31:47 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gaurav.cs.sharma@gmail.com designates 209.85.213.43 as permitted sender) Received: from [209.85.213.43] (HELO mail-yw0-f43.google.com) (209.85.213.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 23:31:41 +0000 Received: by yhl10 with SMTP id 10so5540027yhl.2 for ; Mon, 20 Aug 2012 16:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=66hbMEMe6qxOUzNm8cu/ujSyu7YN4pZFEklItWhxDGU=; b=jTBT9/uaCqqV57iEyUIstINUeoj6YZUoZ49fqSADgB3oFZ0g+/Hq0QBy4uczBc21ej cA/LSma6TG7SpwnDlxRxf/ZRkmBzUYgSCbLE7Rhwy6PsbJFoNiFJYnfsJow0mmTEsO/T y6pgyy1Xkq+5jgaHvsFq+aDIILnXdYFavHUE7xYukPxoRkjHc9E/OeNHTQcvMLhQi2HY WbwsH2Mbv0SSl4bJ4WVLuQw72CBrPBevKIYK1Te/6lpUBN4HDpxnJIKWvbUbyVyLEX9t Ni2ONw0kvkXoUQCdxV/ex0L/Mzqy9lPLrcnMOWTEz76XLD3ryey15PJyCWsFRNKfm85n ynzA== Received: by 10.60.6.73 with SMTP id y9mr11824519oey.17.1345505480835; Mon, 20 Aug 2012 16:31:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.25.135 with HTTP; Mon, 20 Aug 2012 16:31:00 -0700 (PDT) In-Reply-To: <1345499864367-4655332.post@n4.nabble.com> References: <1345480110863-4655304.post@n4.nabble.com> <1345486615667-4655325.post@n4.nabble.com> <1345499864367-4655332.post@n4.nabble.com> From: Gaurav Sharma Date: Mon, 20 Aug 2012 16:31:00 -0700 Message-ID: Subject: Re: Implementing Request Response mechanism To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=e89a8ff250143a82b704c7bae87e X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff250143a82b704c7bae87e Content-Type: text/plain; charset=ISO-8859-1 So, that request-response recipe uses temporary destinations to route messages. Your use-case is that of request-throttling and load-balancing the 'service'. Why not use something designed for that purpose like nginx and its http_limit_conn module? ActiveMQ does have the producer flow-control feature but that throttles based off of resource utilization (see: http://activemq.apache.org/producer-flow-control.html). On Mon, Aug 20, 2012 at 2:57 PM, zackhasit wrote: > Thanks a lot for the code. I looked at it but if you can provide some > comments it might help as I am only familiar with whats at > > http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html > and not inner workings. > > But first question that comes to mind is if HTTP is right protocol. For > regular communication (with one broker) does it use same HTTP protocol or > its something more light weight (openwire / stomp )? Shoudl we use that ? > (Maybe I dont understand what you are doing and thats the confusion...) > > Secondly, is this only way to communicate with multiple brokers. I looked > at > the code here > ( > http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html > ) > Based on this code cant I just set up combine client and server code in one > process and run it as : > > public static void main(String[] args) { > new Server(); > new client(); > } > > In doing so I can have different values for variable "messageBrokerUrl = > "tcp://localhost:61616";" for client and server. Such that when client > sends > requests it sends to one broker connection in client class defined in code > and server class implements onMessage() function to receive from different > connection ? Is something like that possible (more standard implementation) > ? > > > >>messaging service/broker as a sort of rate-control/throttling mechanism > between client-server? > Yes (and load balancing where 3 consumers for 1 producer....). > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Implementing-Request-Response-mechanism-tp4655304p4655332.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > --e89a8ff250143a82b704c7bae87e--