This discussion is archived
2 Replies Latest reply: Jun 4, 2012 1:24 PM by 941282 RSS

A single message which takes long time to process by MDB blocks others

941282 Newbie
Currently Being Moderated
A tricky question: there is one weblogic server, one queue, and a MDB attached to this queue with all default settings (including default work manager).

You put first message in queue, and suppose it takes one hour to process it by MDB (i.e. to return from onMessage method).

Then you put second message in this queue, suppose it takes seconds to process it. Weblogic creates another MDB instance and uses it to process second message concurently with the first one. Good.

After second message has been processed, you put third one. This time too weblogic takes it from queue, and uses another MDB to process it concurently. Still good.

Then you put fourth, fifth, sixtx, and so on and everything goes smoothly until you put seventeenth message in the queue. This time weblogic leaves it in queue and does not process it concurently.

Then you put eightteenth message, and suprise! Weblogic uses the other MDB to process it (but the seventeenth message is still in queue).

If you continue, you'll observe that every 16-th message is not processed by MDB. They stick in queue in pending state.

When will they be processed? Only after the first message (the one that takes one hour to process) finishes.

Be warned...
  • 1. Re: A single message which takes long time to process by MDB blocks others
    Tom B Expert
    Currently Being Moderated
    Hi,

    You're seeing expected and documented behavior that's tunable. By default, WebLogic "pre-pushes" up to 10 messages to each asynchronous consumer - including MDB consumers. To tune (A) configure a custom connection factory with "MessagesMaximum" set to 0 (or perhaps ?1? -- the default is 10), (B) target the CF to the same cluster as the JMS Server (or same WL Server if you're non-clustered), and (C) ensure that your MDB CF annotation or descriptor attribute references the JNDI name of the custom connection factory.

    For more information see the MDB and JMS chapters of the Performance & Tuning guide in the edocs.

    HTH,

    Tom
  • 2. Re: A single message which takes long time to process by MDB blocks others
    941282 Newbie
    Currently Being Moderated
    Hey, this is it! Thank you very much! I was hopeless because Oracle Support couldn't help me for ten days, and you've solved my problem in no time!

    After changing MessagesMaximum to 1 there are no delays.