activemq-users mailing list archives

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

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
below:

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

        <amq:destinationPolicy>
            <amq:policyMap>
                <amq:policyEntries>
                    <amq:policyEntry queue="auditLogQueue"
memoryLimit="10mb"/>
                </amq:policyEntries>
            </amq:policyMap>
        </amq:destinationPolicy>
        <amq:transportConnectors>
            <amq:transportConnector uri="tcp://localhost:0"/>
        </amq:transportConnectors>
    </amq:broker>

    <amq:queue id="auditLogQueue"
physicalName="sky.oogway.audit.log.queue"/>

    <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,
cheers,
Ian

--
View this message in context: http://activemq.2283324.n4.nabble.com/Limiting-the-size-of-a-queue-tp3576502p3576502.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message