Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 37763 invoked from network); 27 Jul 2006 10:46:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jul 2006 10:46:05 -0000 Received: (qmail 34388 invoked by uid 500); 27 Jul 2006 10:46:05 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 34220 invoked by uid 500); 27 Jul 2006 10:46:04 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 34211 invoked by uid 99); 27 Jul 2006 10:46:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2006 03:46:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2006 03:46:02 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1G63N7-0007s6-NE for activemq-users@geronimo.apache.org; Thu, 27 Jul 2006 03:45:41 -0700 Message-ID: <5518812.post@talk.nabble.com> Date: Thu, 27 Jul 2006 03:45:41 -0700 (PDT) From: Paul French To: activemq-users@geronimo.apache.org Subject: [NEWBIE] Toplogy Question (Confusion Reigns!!) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-Sender: paul.french@frenchiesystems.com X-Nabble-From: Paul French X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Morning all (well it is here), I've been scanning the forums, reading blogs and articles for the last few days and I think I know what I need to do. It would be great if someone could confirm my thoughts or shoot me down in flames!! I am in the process of wrapping ActiveMQ around my timetable request service so that it can be used in a web environment. Before I start it should be noted that the timetable request service has to be started with a pre-configured number of threads. The reason for this is that each thread has to create a large in memory structure so that the algorithm runs as fast as possible. I think this means I cannot use Lingo since I think Lingo is responsible for starting a number of pre-configured threads where each thread consumes a message and then calls the appropriate method on your service interface? I am going to have a number of timetable request servers all running a number of pre-configured threads where each thread pulls a timetable request object from one queue running on another machine (the broker machine). >From my understanding it appears all I need to do is have one JmsTemplate shared among the timtetable request threads where each thread will have their own session. I realise that I must use a org.springframework.jms.connection.SingleConnectionFactory so that the same JMS connection is used. Each thread will simply call receive() and will block and wait for a message to be received from the queue. Out of interest if 4 threads call receive() at the same time and there is 4 timetable query objects on the queue will each thread get an object? (a timetable request takes about 0.5seconds to process). Does ActiveMQ automatically distribute messages in a round robin fashion when there is multiple consumers listening on a single queue? Now if we look at the web server that sends a timetable request object to the queue, it seems that having one jmsTemplate shared amongst the web server threads is sufficient where we reuse the same jms connection via the SingleConnectionFactory. We simply call send. Now since I do not require persistence or any transactional behaviour ActiveMQ will send the messages async and so this should be quick and my web server threads will not be blocked which is good!! I assume ActiveMQ will send the messages in the background? What configuration options do I have here like the concurrency of messages being sent in the background? >From a web user point of view after the user has made a timetable request using their browser I think the best thing to do is to display a wait page that re-polls the web server every 2 seconds say. The web server will check if the query has been answered and if so will display it. If not it will re-display the wait page again. The users timetable query object will be saved in their web session. Now where I am struggling is working out how to do obtain the timetable result. Do I also setup on each web server a temporary queue and have this queue specified in the "JMS reply to" message header in the timetable request object message? When I send back the timetable result object to the web sever (i.e. the temporary queue) do I setup a listener container e.g. org.springframework.jms.listener.DefaultMessageListenerContainer that will consume the messages in parallel from the temp queue and then update the appropriate timetable query objects saved in the user sessions with the given timetable results object? I apologise for this being a mouthful but I've only started looking at ActiveMQ and the new JMS support in Spring 2.0 in the last few days. What has really slowed down my understanding of all the offerings out there like Lingo, Spring JMS support, Jencks container and ActiveMQ is the lack of clarity on all the different threads running and how it all fits together. Any assistance would be gratefully recieved. Any pointers to any other sources of information that I have missed would also be very beneficial. Many thanks in advance!! -- View this message in context: http://www.nabble.com/-NEWBIE--Toplogy-Question-%28Confusion-Reigns%21%21%29-tf2008876.html#a5518812 Sent from the ActiveMQ - User forum at Nabble.com.