Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 97914 invoked from network); 3 Nov 2009 00:43:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Nov 2009 00:43:10 -0000 Received: (qmail 52773 invoked by uid 500); 3 Nov 2009 00:43:09 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 52730 invoked by uid 500); 3 Nov 2009 00:43:08 -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 52720 invoked by uid 99); 3 Nov 2009 00:43:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2009 00:43:08 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2009 00:43:06 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N57Tx-0004HU-BT for users@activemq.apache.org; Mon, 02 Nov 2009 16:42:45 -0800 Message-ID: <26159873.post@talk.nabble.com> Date: Mon, 2 Nov 2009 16:42:45 -0800 (PST) From: stirlingc To: users@activemq.apache.org Subject: Observing messages passing through a queue MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: schow@alarmpoint.com Hello, I have an architecture in which one or more message producers place messages in a shared queue and a consumer pool processes the messages. While I can use JMX to monitor the number of messages produced and consumed, the messages are consumed so fast that I often can't browse them with JMX. To monitor the system and debug issues, I would like to keep a JMX-viewable history of the most recently produced messages. My thoughts were to use a composite destination so that any message placed in the shared queue are replicated to another queue without any consumers. The problem is that I would like to cap the size of this historical queue, preferably by count (e.g., only store the last 200 messages that were sent). Alternatively, I could use message time-to-live (TTL) to age the messages within the queue. The problem with TTL is that it must be set by the message producer and would therefore impact both the shared and historical queues. Ideally, I'd like to configure the composite destination to set the TTL only on the messages replicated to the historical queue. Unfortunately, it seems like the only way to do this is to create a consumer for the "primary" historical queue which simply sets the TTL and forwards the messages to a "secondary" historical queue. So here are my questions: 1) Is it possible bound the queue size so that if a new message and the queue size is exceeded, the oldest message in the queue is removed/expired? E.g., make a rollover queue that shows just the last 200 messages sent. I imagine this can be done with application code and a queue browser, but I'd prefer to achieve it with configuration. 2) If a fixed size is not possible, can the time-to-live on a message be set as a property of the queue's configuration rather than the message, or as a property applied during resolution of a composite destination? 3) Is there a better way to achieve my goal of creating a JMX-viewable bounded history of a queue's contents? Thanks for taking the time to read this, Stirling -- View this message in context: http://old.nabble.com/Observing-messages-passing-through-a-queue-tp26159873p26159873.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.