spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Enable sending String payloads with JSON content type in SqsTemplate

Open tomazfernandes opened this issue 9 months ago • 8 comments

Currently due to Spring Messaging internals if we send a String message containing a JSON without specifying a Content-Type it'll default to text/plain in the StringMessageConverter.

If we set .header(MessageHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON), it will be mapped by MappingJackson2MessageConverter which will double serialize the payload, which won't be readable.

We should look into a way of enabling users to send a String json with APPLICATION_JSON content type so it can be properly deserialized by the consumer.

tomazfernandes avatar May 02 '24 03:05 tomazfernandes