spring-cloud-aws
spring-cloud-aws copied to clipboard
Enable sending String payloads with JSON content type in SqsTemplate
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.