From users-return-28606-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Fri Aug 19 13:53:25 2011
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 7F30D7E4E
for ; Fri, 19 Aug 2011 13:53:25 +0000 (UTC)
Received: (qmail 78821 invoked by uid 500); 19 Aug 2011 13:53:25 -0000
Delivered-To: apmail-activemq-users-archive@activemq.apache.org
Received: (qmail 78709 invoked by uid 500); 19 Aug 2011 13:53:23 -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 78701 invoked by uid 99); 19 Aug 2011 13:53:23 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 13:53:23 +0000
X-ASF-Spam-Status: No, hits=2.2 required=5.0
tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL
X-Spam-Check-By: apache.org
Received-SPF: neutral (athena.apache.org: local policy)
Received: from [74.125.82.171] (HELO mail-wy0-f171.google.com) (74.125.82.171)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 13:53:15 +0000
Received: by wyh13 with SMTP id 13so2829889wyh.2
for ; Fri, 19 Aug 2011 06:52:53 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.217.4.12 with SMTP id t12mr550723wes.30.1313761631661; Fri, 19
Aug 2011 06:47:11 -0700 (PDT)
Received: by 10.216.54.69 with HTTP; Fri, 19 Aug 2011 06:47:11 -0700 (PDT)
X-Originating-IP: [190.244.58.189]
Date: Fri, 19 Aug 2011 10:47:11 -0300
Message-ID:
Subject: Stack-like queue
From: =?ISO-8859-1?Q?Mat=EDas_Garc=EDa_Isa=EDa?=
To: users@activemq.apache.org
Content-Type: multipart/alternative; boundary=20cf301e31115fec5b04aadbf7ee
--20cf301e31115fec5b04aadbf7ee
Content-Type: text/plain; charset=ISO-8859-1
Hi all...
Another one here trying to implement kind-of-a-stack with an ActiveMQ queue.
I've allready read about using Camel's resequencer, but didn't seem to help
too much.
What I need is to periodically sort a queue, so the messages get sorted from
newer to oldest. But they still have to be in the same queue.
Implementing a Camel route didn't work, because Camel will consume the
messages and retain them until it complete's its timeout or message count
limit, and then will send the messages to the queue, at the bottom of it. It
could probably work if it had some kind "sleep time" between each resquence
(say, resequence all queue, then send back messages, and sleep for, say, a
couple of hours, and then resequencing again), but I couldn't find out how
to do that.
Since we use Mule ESB, I tried to implement a quartz job that consumes all
messages in the queue, sort them, and send them back in order. It seemed to
be a good approach, but it had the risk of loosing messages if Mule went
down while resorting, so decided to use ackwnoldeged session.
I consume all messages, sort them, and then send them back one by one,
sending individual ack for each message sent. It should be a secure way to
do this, but it doesn't seem to scale too much: testing, just 2500 messages
out of 10k are being read. I think there would be some ActiveMQ limitation
about having too many blocked messages, but I'm not sure neither...
Apart from expecting a queue provider to work like a stack, what am I doing
wrong? What else could I try? Any ideas or suggestions will help
Thanks for reading :)
--20cf301e31115fec5b04aadbf7ee--