camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Holunder <dennish...@gmail.com>
Subject preserve custom exchange id or custom message id
Date Wed, 29 Nov 2017 13:40:05 GMT
Hi,

for easier reading logs I'd like to append db record id to the
exchange id, but it only works in current route. After the exchange is
sent to queue, the appended part is lost

from("direct:source")
    .setBody("id from DB)
    .process(exchange->
exchange.setExchangeId(exchange.getExchangeId() + "-myid-" +
exchange.getIn().getBody()))
   .process(exchange -> System.out.println(exchange.getExchangeId())
    to(queue);

// now in queue "-myid-" is not present
from(queue()).process(exchange -> System.out.println(exchange.getExchangeId()));


Is there a way to preserver the changed id?

Dennis

Mime
View raw message