Mule

Mule stops sending JMS messages when large number of messages are queued up

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: To be reviewed To be reviewed
  • Resolution: Won't Fix or Usage Issue
  • Affects Version/s: 2.1.2
  • Fix Version/s: None
  • Component/s: Transport: JMS
  • Labels:
  • Environment:

    My environment is Mule 2.1.2, ActiveMQ 5.1.0 and JDK 1.5.0 on Mac OS X 10.5.6

Description

I have noted a problem with Mule and ActiveMQ where Mule stops sending JMS messages when no receiver consumes the messages sent by Mule.
Mule stops sending after some 2200 messages (1 kB each) are placed on the out-queue.

I have attached my Mule config and a sample JMS Producer and Consumer.

My environment is Mule 2.1.2, ActiveMQ 5.1.0 and JDK 1.5.0 on Mac OS X 10.5.6

Test Scenario: Producer --> in-queue --> Mule --> out-queue --> Consumer
(Using the ActiveMQ Console to monitor queue-depth)

1. Only ActiveMQ and Mule are started and the queues are empty
in-queue: 0 messages
out-queue: 0 messages

2. Start Producer (sends 2000 messages)

  • all messages are consumed by Mule and send to its out-queue as expected.
    in-queue: 0 messages
    out-queue: 2000 messages

3. Start Producer again (sends 2000 messages)

  • PROBLEM: Only some of the messages from the in-queue are processed by Mule and sent to the out-queue
    in-queue: 1779 messages
    out-queue: 2220 messages

4. Start Producer a third time (sends 2000 messages)

  • PROBLEM REMAINS: Sometimes the Producer hangs and sometimes is succeeds in sending its messages but nothing is passed on by Mule to the out-queue.
    in-queue: 3779 messages if producer succeeds and for example 2511 messages if the Producer hangs
    out-queue: 2220 messages

5. Start Consumer

  • The hanging Producer (if any) completes and the Consumer process all 6000 messages, both queues are now empty again as expected!
    in-queue: 0 messages
    out-queue: 0 messages

So no messages are lost, Mule does however not process them until the Consumer is started!
I can easily send 10 000 messages to the out-queue using the Producer directly so it seems not to be an "ActiveMQ only" problem.

I don't know on how to proceed with error analysis, any help would be very appreciated.

Regards,
Magnus.

  1. LoadTestJmsConsumer.java
    10/Feb/09 12:13 AM
    4 kB
    Magnus Larsson
  2. LoadTestJmsProducer.java
    10/Feb/09 12:13 AM
    3 kB
    Magnus Larsson
  3. sample-jms-router-config.xml
    10/Feb/09 12:13 AM
    2 kB
    Magnus Larsson

Activity

Hide
Magnus Larsson added a comment - 10/Feb/09 01:11 AM

Tried the above with ActiveMQ 4.1.1, same result but at a later stage.

Mule stops sending messages from the in-queue to the out-queue after some 6398 messages and the producer that sends messages to the mule in-queue hangs until the consumer is started (consuming messages from the out-queue).

Show
Magnus Larsson added a comment - 10/Feb/09 01:11 AM Tried the above with ActiveMQ 4.1.1, same result but at a later stage. Mule stops sending messages from the in-queue to the out-queue after some 6398 messages and the producer that sends messages to the mule in-queue hangs until the consumer is started (consuming messages from the out-queue).
Hide
Andrew Perepelytsya added a comment - 10/Feb/09 09:47 AM

That led me to a point - AMQ had a hard limit on the queue size (like any jms provider, basically). Once the queue is full, no more messages are accepted. Can you check the counts via AMQ's JMX console?

Show
Andrew Perepelytsya added a comment - 10/Feb/09 09:47 AM That led me to a point - AMQ had a hard limit on the queue size (like any jms provider, basically). Once the queue is full, no more messages are accepted. Can you check the counts via AMQ's JMX console?
Hide
Andrew Perepelytsya added a comment - 10/Feb/09 05:10 PM

Well, it's a classic RTM case

To the point, it was just what I suspected: http://activemq.apache.org/producer-flow-control.html Attached tests don't send 2000 messages, they submit a non-transactional batch of 2000 messages in a single session. That's a big difference, and a really really bad performance test Production environments will 99% of times require transactional processing of jms messages, where each messages is handled individually of the rest.

You can quickly disable the producer flow control by running jconsole and connecting to the process. Then go to org.apache.activemq -> Queue -> Soalabs.LaodTests.In -> Attributes -> ProducerFlowControl -> false (run the producer at least once, it'll create the dynamic queues). After that post as many messages as you wish (or rather, the max memory limit set on the queue, which is also tweakable).

Cheers!

Show
Andrew Perepelytsya added a comment - 10/Feb/09 05:10 PM Well, it's a classic RTM case To the point, it was just what I suspected: http://activemq.apache.org/producer-flow-control.html Attached tests don't send 2000 messages, they submit a non-transactional batch of 2000 messages in a single session. That's a big difference, and a really really bad performance test Production environments will 99% of times require transactional processing of jms messages, where each messages is handled individually of the rest. You can quickly disable the producer flow control by running jconsole and connecting to the process. Then go to org.apache.activemq -> Queue -> Soalabs.LaodTests.In -> Attributes -> ProducerFlowControl -> false (run the producer at least once, it'll create the dynamic queues). After that post as many messages as you wish (or rather, the max memory limit set on the queue, which is also tweakable). Cheers!

People

Vote (0)
Watch (1)

Dates

  • Created:
    10/Feb/09 12:11 AM
    Updated:
    10/Feb/09 05:11 PM
    Resolved:
    10/Feb/09 05:10 PM