[ 
https://issues.apache.org/jira/browse/CAMEL-15892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-15892.
---------------------------------
    Resolution: Information Provided

> CamelJmsDestinationName header ignored (when set in dlc.onPrepareFailure)
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-15892
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15892
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jms
>    Affects Versions: 3.6.0
>            Reporter: Bernard Ligny
>            Priority: Minor
>
> I'm trying to setup a smart JMS DeadLetterChannel where the final uri of the 
> DLQ is computed dynamically, depending on original queue name (eg adding a 
> ".dead" suffix).
> I have seen in the doc that it's possible by setting the 
> *CamelJmsDestinationName* header:
> [https://camel.apache.org/components/latest/jms-component.html#_reuse_endpoint_and_send_to_different_destinations_computed_at_runtime]
> Therefore, I tried this:
> {code:java}
> DefaultErrorHandlerBuilder dlc = deadLetterChannel("jms:queue:dummy")
>             .useOriginalMessage()
>             .maximumRedeliveries(2);                
> dlc.onPrepareFailure( exchange -> {
>      // Override destination                                
>      exchange.getMessage().setHeader("CamelJmsDestinationName", 
> "jms:queue:test");                   
> });
> {code}
> I have tried many different values for *CamelJmsDestinationName* :
>  - "jms:queue:test"
>  - "queue:test"
>  - "test"
> But none of them is working; the header is ignored and the exchange always 
> goes to original uri ("queue:dummy").
> I'm using Camel 3.6 and 
> *camel-{color:#de350b}s{color}jms{color:#de350b}2{color}* component bound to 
> an Artemis ActiveMQ broker (the one bundled with Wildfly20):
> {code:java}
> @Resource(mappedName = "java:/ConnectionFactory")
> private static ConnectionFactory connectionFactory; 
> @Produces
> @ApplicationScoped
> @Named("jms")
> public final Sjms2Component createJmsComponent() {
>     Sjms2Component component = new Sjms2Component();
>     ConnectionResource pool = new ConnectionFactoryResource(poolSize, 
> connectionFactory);
>     component.setConnectionResource(pool);
>     return component;      
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to