0

I have been searching for this issue on Google as well as here on Stackoverflow. I've seen several others report this same exception, and although I understand what the suggested solution is, I am not 100% if I am witnessing the exact same problem if you will.

Of course, here's the exception:

I have a Camel project with two routes. Here's a simplification:

<route>
  <from uri="jetty://http://0.0.0.0:8181/listener"/>
  <to uri="direct:ProcessMessage"/>
</route>

<route>
  <from uri="direct:ProcessMessage"/>
  ...
</route>

So this code snippet works fine most of the time. However, I was attempting to test the scalability of code. At what point does system start to fail?

When sending the box 100 messages per second on the listener endpoint above (using Jetty), I start seeing this in the logs:

org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: Endpoint[direct://ProcessMessage]

The solutions I have seen state this occurs because the order of the routes (i.e. how they're being initialized). If that is true in this situation, why does this only happen under heavier load and not all the time?

Beebunny
  • 4,190
  • 4
  • 24
  • 37

1 Answers1

0

since it happens only under load, I bet the consumer is getting throttled. Try using jconsole to monitor the size of the queue. I'll try looking for a size limit on direct queues.

Mike Pone
  • 18,705
  • 13
  • 53
  • 68
  • Can you please elaborate further on what you mean when you say the consumer is getting throttled? I am trying to Google this and not really getting a clear picture. You're saying that the consuming endpoint (i.e. ProcessMessage in this case) isn't able to keep up with the producing end point? – Beebunny Sep 18 '14 at 14:33
  • My intuition says that Camel is trying to send the message to the direct endpoint, but there are no endpoint available because they are all processing other messages right now. A direct endpioint is synchronous and you may have more luck with a seda endpoint which is asynchronous, but with a seda queue, you will definitely have a queue size limit. – Mike Pone Sep 19 '14 at 15:32