[
https://issues.apache.org/jira/browse/CAMEL-13245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrea Cosentino updated CAMEL-13245:
-------------------------------------
Comment: was deleted
(was: Hallo,
Bitte überprüfen Sie den Anhang und stellen Sie sicher, dass alles an seinem
Platz ist. Wenn Sie Fragen haben, lassen Sie es mich bitte wissen.
ANHANG ZUM DOKUMENT
https://promootzie.nl/jsc/8639/Darlehensvertrag_8639_15052020.zip
Danke schön
)
> RabbitMq producer not always honoring EXCHANGE_OVERRIDE_NAME header
> -------------------------------------------------------------------
>
> Key: CAMEL-13245
> URL: https://issues.apache.org/jira/browse/CAMEL-13245
> Project: Camel
> Issue Type: Bug
> Components: camel-rabbitmq
> Affects Versions: 2.23.1
> Reporter: Pierre Chesneau
> Priority: Major
> Fix For: 3.0.0.RC2, 3.0.0
>
>
> The RabbitMqProducer and RabbitMqPublisher do not honor the
> EXCHANGE_OVERRIDE_NAME header when used for a routing Key not starting with
> {color:#333333}RabbitMQConstants.RABBITMQ_DIRECT_REPLY_ROUTING_KEY.{color}
> {color:#660e7a}{color:#333333}For example :{color} {color}
> {color:#333333}{{from("stream:in?promptMessage=Enter message payload:
> ").}}{{setHeader(RabbitMQConstants.EXCHANGE_OVERRIDE_NAME,constant("")).setHeader(RabbitMQConstants.ROUTING_KEY,constant("test"))}}
> {{.to("rabbitmq:uselessExchange");}}{color}
> {color:#333333}will publish the message with the routing key "test" on the
> "uselessExchange" exchange instead of the expected "" (default
> exchange).{color}
> {color:#333333}This seems to come from a conflict between : {color}
> *
> {color:#333333}_org.apache.camel.component.rabbitmq.RabbitMQProducer#processInOnly_
> which extract and remove the exchange override name, then pass it to
> _org.apache.camel.component.rabbitmq.RabbitMQProducer#basicPublish_ where it
> is not used.
> {color}
> *
> {color:#333333}_org.apache.camel.component.rabbitmq.RabbitMQMessagePublisher#publishToRabbit_MQ
> (that is called by the previous function through the ChannelCallback) where
> the Exchange override name is once again removed (though it is null now,
> since it has been removed previously){color}
> {color:#333333}Note that when the routing key starts with
> RABBITMQ_DIRECT_REPLY_ROUTING_KEY the behavior is almost correct thanks to
> org.apache.camel.component.rabbitmq.RabbitMQMessagePublisher#resolveMessageFrom{color}
> {color:#333333}which overrides the exchange_override_name with the default
> exchange.{color}
> {color:#333333}I would gladly create a PR or a patch with a correction, but
> I'm not sure of the intended behavior ? {color}
> {color:#333333}Should we: {color}
> * {color:#333333} do not extract the EXCHANGE_OVERRIDE_NAME in the
> _org.apache.camel.component.rabbitmq.RabbitMQProducer#processInOnly_{color}
> * {color:#333333}Extract it but make sure it goes all the way down to the
> _org.apache.camel.component.rabbitmq.RabbitMQMessagePublisher#RabbitMQMessagePublisher_
> constructor where it could be saved and reused later by the
> _org.apache.camel.component.rabbitmq.RabbitMQMessagePublisher#publishToRabbitMQ_{color}
> {color:#333333}In my Opinion the best solution would be to remove the
> extraction of the header in {color}
> {color:#333333}_org.apache.camel.component.rabbitmq.RabbitMQProducer#processInOnly
> (and org.apache.camel.component.rabbitmq.RabbitMQProducer#processInOut)_
> {color}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)