I would like to generate responses on my queue with content type application/json because payload contains the json object.
But...
Don't know why my spring-stream (based on RabbitMQ) always generates the message with below headers (payload is correct and has JSON form).
(view from rabbit ui)
properties:
delivery_mode: 2
headers:
contentType: text/plain
originalContentType: application/json;charset=UTF-8
content_type: text/plain
So the content_type equals to text/plain instead of application/json;charset=UTF-8.
I have tried to set content-type in configurations like:
spring:
cloud:
stream:
default:
content-type: application/json
bindings:
my-channel:
content-type: application/json
destination: my-channel-rs
producer:
exchange-type: direct
max-length: 1000
but did not help.
I have the feeling that in correct response the single header content-type should exist with value "application/json".
But maybe I am wrong? Is anybody able to explain above behaviour?