This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Is Message header id unique?

Jan 15th, 2013, 01:38 PM

We use spring integration <si-jdbc:inbound-channel-adapter> to retrieve messages from a staging table (25 rows/poll). After split and transform, each record will be saved as an event to an event table. One of the fields we save to the event table is UUID, which is from the message header id (@Header("id")). We found records with duplicate UUID in the event table. Most of them are 2 in a pair with the same creation time stamp. By looking at other columns in the table, we can tell they are different events. My understanding is the message header id is an UUID, which should not give duplicates. Please help.

Comment

I turned on the spring integration package to DEBUG and see the ids were different in org.springframework.integration.transformer.Messag eTransformingHandler. But when they reached our transform method, they became the same. Here is the debug. We use WAS workmanager and the debug shows thread 5 and thread 2:

Comment

Hi!
Sorry, now it's difficult to read your post. Please, highlight problems.
At a glance you mean MessageFilter, which really doesn't do anything with Message. Look at this as Validator.
So, you see here not the same Message id, but the same Message object.
By the way 'empty' transformer will do the same, if pass to him entire Message.

Comment

The Debug that prints the id is the first line in the transformer transform method. We use @Header("id") to get the message id. It seems to me that when the id was passed to transformEvent method, it already got mixed up with another message. Please see the following transformEvent code. Thanks so much for the help.