Hi

This is expected, exchange properties are local only to the current
Exchange.
If you send data over network protocols like pulsar, kafka, jms then
the payload is only from the message (eg body and headers)



On Thu, Apr 13, 2023 at 11:24 PM Steve973 <steve...@gmail.com> wrote:

> Hello.  I am sending an exchange with a FluentProducerTemplate to a pulsar
> endpoint.  When a route reads from that endpoint, the exchange property
> that I set is no longer there.  This is how I am sending the message:
>
> Exchange exchange = ExchangeBuilder.anExchange(camelContext)
> .withProperty("command", MessageTypes.GENERATE_NUMBERS_COMMAND)
> .withBody(generateNumbersCommandMessage.toByteArray())
> .build();
> fluentProducerTemplate.withExchange(exchange)
> .to(commandUri)
> .send();
>
> I am reading from the same URI to feed a route where I log the exchange:
>
> from(mainRouterConfig.commandEntrypoint())
> .to("log:to.dynamic-router.command.route?showAll=true&multiline=true")
> .to("%s:%s?recipientMode=%s".formatted(
> COMPONENT_SCHEME, mainRouterConfig.routingChannel(), mainRouterConfig
> .recipientMode()));
>
> The exchange property is absent in the log message:
>
>   Id: 453CF424AB353C4-0000000000000000
>  ExchangePattern: InOnly
>  Properties:
>
> {CamelToEndpoint=log://to.dynamic-router.command.route?multiline=true&showAll=true}
>
>  Headers: {CamelMessageTimestamp=1681420673229,
> CamelPulsarRedeliveryCount=0, event_time=0, key=null, key_bytes=null,
> message_id=0:0:-1, producer_name=standalone-0-11, properties={},
> publish_time=1681420673229
> , sequence_id=0,
> topic_name=non-persistent://public/default/numbers/command}
>  BodyType: byte[]
>  Body: generateNumberstypesequentialstart0limit1000000
>
> Am I doing anything obviously wrong?  Or is the Pulsar component eating
> exchange properties?
>
> Thanks,
> Steve
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to