PDA

View Full Version : springintegration_correlationId lost in header when sent over jms



jaspa
Dec 21st, 2009, 04:53 AM
Hi,

I'm new to Spring integration and while attempting to use the resequencer from messages read from a JMS queue, I get the following error :

Resequencer requires the 'correlationKey' property

The flow I am trying to implement is :

File -> Splitter (adding SEQ_SIZE and SEQ_ID) -> JMS outbound channel adapter -> JMS inbound channel adapter -> Resequencer -> stdout

It looks like the problem is caused because the springintegration_correlationId is not added to the headers of a JMS message.

springintegration_correlationId is a UUID.class object, but the DefaultJmsHeaderMapper will only copy header values of types :
Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class

Is what I am attempting the correct approach. If so, should I be creating my own JmsHeaderMapper?

I am using SI 2.0.0-M1

JMS Header:
DEBUG: org.springframework.integration.jms.HeaderMappingM essageConverter - converted JMS Message [
JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:414d5120444556415050303120202020cb5f894a02513a2 0
JMSTimestamp: 1261389283402
JMSCorrelationID: null
JMSDestination: queue:///queue.demo
JMSReplyTo: null
JMSRedelivered: false
JMSXAppID: WebSphere MQ Client for Java
JMSXDeliveryCount: 1
JMSXUserID: mqm
JMS_IBM_Character_Set: UTF-8
JMS_IBM_Encoding: 273
JMS_IBM_Format: MQSTR
JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 28
JMS_IBM_PutDate: 20091221
JMS_IBM_PutTime: 09544353
springintegration_file_name: 07ch12.dat
springintegration_sequenceNumber: 1
springintegration_sequenceSize: 1
springintegration_timestamp: 1261389281527

iwein
Dec 26th, 2009, 07:45 AM
I think you should store the uuid as a string and party on.