davsclaus commented on code in PR #28179:
URL: https://github.com/apache/camel/pull/28179#discussion_r4325623614
##########
components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubProducer.java:
##########
@@ -257,7 +257,7 @@ private Operation getOperation(Exchange exchange) {
}
private String getChannel(Exchange exchange) {
- String channel = exchange.getIn().getHeader(PubNubConstants.CHANNEL,
String.class);
+ String channel =
exchange.getIn().getHeader(PubNubConstants.OVERRIDE_CHANNEL, String.class);
Review Comment:
Optional: this header stays on the message, so a second pubnub producer
later in the same route also uses the override channel. camel-kafka removes its
override header after use
(`message.removeHeader(KafkaConstants.OVERRIDE_TOPIC)`). If you want the same
here, resolve the channel once in `process()` and pass it to the operations.
`getChannel()` is called twice per operation (in the debug log and in the
builder), so removing the header inside this method would send the message to
the endpoint channel on the second call.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]