Search code examples
apache-camelspring-camel

Log apache camel seda queue depth every second via a timer


How can I log actual seda queue depth every second on a timer. E.g.

from("seda:messageParser?concurrentConsumers=5&size=5000)
.process(messageProcessor)
 
from("timer://sedaQueueDepthLogger?fixedRate=true")
.to(LOG_SEDA_QUEUE_DEPTH)

What should be LOG_SEDA_QUEUE_DEPTH above to achieve this?


Solution

  • You cannot log it that easily. From a custom processor, you can get the seda endpoint, and from there you have APIs to get the queue, and get the size, which you can then log.

    There is also JMX API to find that information.