camel-users mailing list archives

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

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 <http://pastebin.com/q7A55GDn>  )
and added a third route-c. Now the test routes look like this:

Route-A:

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

Route-B:

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

Route-C

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
fails.

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: http://camel.465427.n5.nabble.com/ActiveMQ-Component-doesn-t-return-breadcrumbId-tp5750598.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message