Hello,
differences are:
my endpoint is using the default exchange (denoted with "default" in Camel instead of "" in RMQ client configuration) and the proper queue and key declaration:
"spring-rabbitmq:default?routingKey=OutBound&queues=OutBound&acknowledgeMode=AUTO"
I have added a Spring Message converter to control the conversion of the message more directly on the Spring layer, declaring a subclass
of org.springframework.amqp.support.converter.SimpleMessageConverter in the application context. So I am able to see the headers like below.
Instead of using the contentType to derive the proper message conversion, i know the payload should be a JSON String so, directly creating a new String, but with the result shown below. So no difference to the previous version.
message properties:
MessageProperties [headers={refNo=XXX, JMSMessageID=ID:5c04208d-9a9b-4ee4-94ae-70413c869b27, vpoNo=XXXX, JMSTimestamp=1709033485921, updateUser=Karste...@XXX.com, updatedOn=2024-02-27 11:31:23.903, JMSDeliveryMode=PERSISTENT, version=3, JMSPriority=4, docStatus=active, status=scheduled}, contentType=application/octet-stream, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=4, redelivered=false, receivedExchange=jms.durable.queues, receivedRoutingKey=OutBound, deliveryTag=1, consumerTag=amq.ctag-c-XM6pWAHKM-l3puikO79g, consumerQueue=OutBound]
String conversion result:
\u0000\u0005wx\u0000.com.rabbitmq.jms.client.message.RMQTextMessage\u0000$5c04208d-9a9b-4ee4-94ae-70413c869b27\u0000\u0000\u0000\u0006\u0000\u001brmq.jms.message.destination sr\u0000%com.rabbitmq.jms.admin.RMQDestination\bHٍ��&)\u0002\u0000\bZ\u0000\u0004amqpZ\u0000\u0007isQueueZ\u0000\u000bisTemporaryL\u0000\u0010amqpExchangeNamet\u0000\u0012Ljava\/lang\/String;L\u0000\ramqpQueueNameq\u0000~\u0000\u0001L\u0000\u000eamqpRoutingKeyq\u0000~\u0000\u0001L\u0000\u000fdestinationNameq\u0000~\u0000\u0001L\u0000\u0015queueDeclareArgumentst\u0000\u000fLjava\/util\/Map;xp\u0000\u0001\u0000t\u0000\u0012jms.durable.queuest\u0000\u0010OI_SB.OIOutBoundq\u0000~\u0000\u0005q\u0000~\u0000\u0005pz\u0000\u0000\u0001�\u0000\u001drmq.jms.message.delivery.mode\u0004\u0000\u0000\u0000\u0002\u0000\u0019rmq.jms.message.timestamp\u0005\u0000\u0000\u0001
.... all the headers encoded ....
... afterwards the real JSON payload
So looks like a printout of a
com.rabbitmq.jms.client.message.RMQTextMessage if I am using the RMQ client (via Spring, Camel), but
using the RMQ JMS i am getting the proper JSON payload.
I cannot deserialize the incoming byte array, because RMQTextMessage is not implementing java.lang.Serializable.
Does contentType=application/octet-stream has strange effects on RMQ client but not on RMQ JMS client?
Any thoughts?
without thoughts
Karsten