From users-return-13440-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Thu Apr 03 05:48:11 2008 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 13663 invoked from network); 3 Apr 2008 05:48:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Apr 2008 05:48:11 -0000 Received: (qmail 89176 invoked by uid 500); 3 Apr 2008 05:48:10 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 89152 invoked by uid 500); 3 Apr 2008 05:48:10 -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 89137 invoked by uid 99); 3 Apr 2008 05:48:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 22:48:10 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jpoloney@gmail.com designates 209.85.132.249 as permitted sender) Received: from [209.85.132.249] (HELO an-out-0708.google.com) (209.85.132.249) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2008 05:47:29 +0000 Received: by an-out-0708.google.com with SMTP id b8so829324ana.65 for ; Wed, 02 Apr 2008 22:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=5o0DNd8ykSe4LAq7fccX5k8ZoEkL99c+RSzpxM22uwM=; b=cwiS52hevUckAGcX7wSO1V92eeWJYRi3aebP5MSP5o+SRH52VEGr8K510RNIkxXdHVFOVYnRFX0AB39cqAMLteqVcgAfE+lUVRCnLQO6nPcStSracWVV8Z4+UcPkb/jT+nHYpan8gFXcqndg+6sKyLUCGNbVSEo4v+fZHTSHOfE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:mime-version:content-type; b=DHJP4CRHbq9MAwZ4dj10FyXU8b953l1goU1KBjJWcFbrlIKPZFfTIQEniJ5VbO9myoreVy2AJJjLU9I9wLPtmfrBf2oAoeVAnWN2CXGDbzYDqRo5+i1lEUJlDZAF3IsKmUtsfYeiZLwFmtEjl+hCBj9LcWp6+JyrtPBEmoYT1wI= Received: by 10.100.122.8 with SMTP id u8mr24770748anc.103.1207201660493; Wed, 02 Apr 2008 22:47:40 -0700 (PDT) Received: by 10.100.189.19 with HTTP; Wed, 2 Apr 2008 22:47:40 -0700 (PDT) Message-ID: Date: Wed, 2 Apr 2008 22:47:40 -0700 From: "Joel Poloney" To: users@activemq.apache.org Subject: Basic queue concept MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_211_10144633.1207201660470" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_211_10144633.1207201660470 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline List, I'm new to message queues, but I generally understand the concept. I've been playing with ActiveMQ this afternoon using the PHP Stomp client to make requests. I noticed that in the Stomp client you don't have access to any given queue size, whereas in the JMS API I have access to these numbers. So, assuming I stick with the Stomp API, I can think of 2 basic ways that I could implement a consumer: 1. I have a consumer in a while(1) { //consume } fashion. That would basically run forever. As I understand it, this is the way most web servers work (at the core, core level). In this model, I would have to make sure that the consumer was always running (perhaps do 3-way redundancy and have 3 consumers doing this). My concern with this model is that if I implement this in PHP, I'm afraid of memory issues and so on. I don't necessarily trust a PHP script to run in a while(1) fashion forever. 2. I could somehow get the queue size and batch process these. Basically, get the queue size (say it was 200 entries), consume 200 messages and then the PHP script would end. Then you would have this script in a cronjob that runs every x amount of time. Unfortunately, I have to implement this in PHP. So, I'm not really sure which way would be the proper way to go about doing this. If any one has any thoughts or comments, it would be greatly appreciated. Thanks, -- Joel ------=_Part_211_10144633.1207201660470--