activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From igrahami <>
Subject Limiting the size of a queue
Date Mon, 06 Jun 2011 09:24:10 GMT

ultimately what I am trying to do seems quite simple. I am wanting to use a
queue to decouple the front and backend of our system by putting a jms queue
in between. The information being put on the queue isn't 100% important, it
is more important that what is going on in the frontend is not blocked by
the backend processing.

I have setup an in vm memory local not persistent queue with all async
options set but limiting by number of messages doesn't seem possible (after
lots of searching) so have managed to setup a limit by memory size in a
policy map. 

I have all the setting setup in spring, section of important bit of config

<amq:broker useJmx="true" persistent="false">

                    <amq:policyEntry queue="auditLogQueue"
            <amq:transportConnector uri="tcp://localhost:0"/>

    <amq:queue id="auditLogQueue"

    <amq:connectionFactory id="amqConnectionFactory"
brokerURL="vm://localhost" sendTimeout="100" useAsyncSend="true"
alwaysSyncSend="false" alwaysSessionAsync="true" dispatchAsync="true"
sendAcksAsync="true" />

Problem is the message producers keep blocking until they get the message
onto the queue, I just want the producer to try and if not possible straight
away then just throw exception (which I will catch and log) and carry on
with frontend work. From much searching this does seem possible but nothing
I try seems to work. I have got round the problem for now by putting the
sendTimeout="100" on the connection factory but ultimately I don't want to
have to have that setting.

Help much appreciated,

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message