2

I am new to JMS and I need some help with managing the JMS/MDB threads.

When I have 20 messages queued and I "start" the MDB all messages are being delibvered at the same time and processed imidiatelly.

What I need is to have only one message that is being processed while all other messages would wait until the processing of the first message is done. I also need those all other messages to be visible via QueueBrowser.

I can't find the solution to this. I found several sources like this one (http://goo.gl/aTvQ4e) which recomends to specify the maxSession or consumerWindowSize properties, but it has no effect for me.

This is how I annotated the MDB now:

@MessageDriven(mappedName = SECONDARY, activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = SECONDARY),
        @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1"),
        @ActivationConfigProperty(propertyName = "consumerWindowSize", propertyValue = "0"),
        @ActivationConfigProperty(propertyName = "maxPoolSize", propertyValue = "1")})
@TransactionManagement(value = TransactionManagementType.CONTAINER)
@TransactionAttribute(value = TransactionAttributeType.REQUIRED)

Please can you help me with this or can you please suggest any other solution how this can be done?

-- To process messages from queue one by one while being able to browse others using the QueuebBrowser?

I use Wildfly-8.1.0

Michael

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418

0 Answers0