camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hude <>
Subject ActiveMQ-Component doesn't return breadcrumbId
Date Fri, 25 Apr 2014 08:12:36 GMT

I don't know if I'm using breadcrumbId wrong, but in my opinion there is
something wrong in how breadcrumbId will handled. I've taken the
MDCWithBreadcrumbTest ( Test in Pastebin <>  )
and added a third route-c. Now the test routes look like this:


direct -> processor -> log -> activemq -> log -> direct:b


direct:b -> processor -> log -> mock


activemq -> processor

The processors are more or less the same as in the original unit test. I
changed also the test "testMDCTwoMessages" to this:


      template.requestBodyAndHeader(ROUTE_A_ENDPOINT, "Hello World",
Exchange.BREADCRUMB_ID, breadcrumbId);

      template.requestBodyAndHeader(ROUTE_A_ENDPOINT, "Bye World",
Exchange.BREADCRUMB_ID, breadcrumbId);


The variable breadcrumbId is a UUID and the processors check if the
breadcrumbId from the exchange is equal to breadcrumbId which was sent.

Now what happens is that the message which was sent to the temp reply queue
didn't contains the property breadcrumbId. But the first check in the
processor of route-b didn't fail because the MDC contains a breadcrumbId.
That is also strange because the processor runs in another thread to route-b
and there is no MDCUnitOfWork instance filling the MDC properties for this
thread. But after finishing the processing a MDCUnitOfWork instance clears
the MDC. Thats the reason why the check for the second call in route-b

If I change the Endpoint of route-b from direct to seda, there is - as
suspected - a MDCUnitOfWork instance filling the MDC. But because the
message which was return from activemq didn't returns the breadcrumbId the
MDCUnitOfWork takes the messageId.

So I’ve two questions:

1. Why activemq didn't return the breadcrumbId though the Exchange has one?

2. Why there isn't a call to the MDCUnitOfWork before entering the direct
route, but after?

Is this behavior expected?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message