Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Complete
-
4.2.4
-
int-amqp + int-redis + int-claimcheck
Description
Trying to use claim-check with Redis store with a message coming from amqp throws "MessageHeaders is immutable" error.
The error is thrown when trying to change message ID in AbstractKeyValueMessageStore.normalizeMessage
Map innerMap = (Map) new DirectFieldAccessor(normalizedMessage.getHeaders()).getPropertyValue("headers"); innerMap.put(MessageHeaders.ID, message.getHeaders().getId());
Configuration is
<int-amqp:inbound-gateway id="signInRabbit" request-channel="signResponses" message-converter="jsonMessageConverter" error-channel="signErrorChannel" connection-factory="rabbitConnectionFactory" mapped-request-headers="*" mapped-reply-headers="*" /> <int:chain input-channel="signResponses" > <int:header-enricher> <int:error-channel value="signErrorChannel"/> </int:header-enricher> <int:claim-check-out id="checkoutServer" message-store="redisMessageStore" /> ......
Work around is override
RedisMessageStore.getMessage(UUID id) to the contents of AbstractKeyValueMessageStore.getRawMessage(UUID)
@Override public Message<?> getMessage(UUID id) { Assert.notNull(id, "'id' must not be null"); Object message = doRetrieve(MESSAGE_KEY_PREFIX + id); return (Message<?>) message; }
Maybe related to INT-2460
Attachments
Issue Links
- relates to
-
SPR-14764 MessageHeaders doesn't use serialization properly
-
- Open
-