user3233451
user3233451

Reputation: 119

Spring Integration - Custom JMSCorrelationId using jms:outbound-gateway

Is it possible to pass a custom JMSCorrelationId while using ?

I want to do this because the consumer system of my messages sets back a payload property as the JMSCorrelationId.

I checked JMSOutboundGateway.java for the same but it seems it ie either use JMSmessageId or generated unique id as JMSCorrelationId to map the incoming messsages.

Any help ?

UPDATE

I am able to set using header-enricher receving input on input channel and this enriched header ouput is received by jms outbound gateway. But i saw the code in JMSOutboundGateway it creates the selector with JMSMessageID because of which i am not able to receive the message.

<int:header-enricher input-channel="input" output-channel="output">
            <int:header name="jms_correlationId" value="12345"/>
        </int:header-enricher>

Any thoughts ?

Upvotes: 0

Views: 1430

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121292

Starting with 4.0.1 the <int-jms:outbound-gateway correlation-key> supports JMSCorrelationID* token to reuse an existing correlationId from request message:

https://jira.spring.io/browse/INT-3405

http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/jms.html#d4e8792

Upvotes: 0

Related Questions