I have a call to an rabbitmq queue, which in return responds with a json payload.
<inSequence>
<call>
<endpoint>
<address statistics="enable" trace="enable" uri="rabbitmq:/AMQPProducerSample?rabbitmq.server.host.name=10.0.0.2&rabbitmq.server.port=5672&rabbitmq.server.virtual.host=dev&rabbitmq.server.vhost=devAuth&rabbitmq.queue.name=hello&rabbitmq.queue.durable=false&rabbitmq.queue.auto.ack=true&rabbitmq.queue.exclusive=false&rabbitmq.replyto.name=false">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>-1</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</address>
</endpoint>
</call>
<header name="Content-Type" scope="transport" value="application/json"/>
<respond description="respond whatever"/>
</inSequence>
But when the answer from the queue return, console shows: [2020-10-19 19:20:39,741] WARN {RabbitMQUtils} - Unable to determine content type for message urn:uuid:88BF095D7137B387921603153239744 setting to text/plain
and it adds "text" to my already json payload: {"text":"{"jwt":"5f8e2d21c2184","error":false}"}
How do I set the answer from the rabbitmq to json or do I need to tansform that answer? because it get all strip protected.
The type of the answer, is set by the endpoint as an attribute to the message, as stated by de rabbitmq documentation: https://www.rabbitmq.com/consumers.html#message-properties In case of the php rabbitmq library add 'content_type'=>'application_json' to property array of the message.