The exchange of messages between clients and the embedded SwiftMQ router can take place via JMS, AMQP, and MQTT. Messages arrive as JMS messages at the queue or topic, regardless of which protocol was used for the transfer.
JMS messages are not transformed. They arrive in the queue or topic as is.
AMQP messages are transformed according to AMQP 1.0 and AMQP 0.9.1 message transformation.
MQTT messages arrive as JMS BytesMessage.
Messages in the source queue or topic are converted into a Kafka record as follows:
BytesMessage
bodies to a byte array.
TextMessage
bodies to a string.
MapMessage
bodies to a JSON object (stringified).
Message
without a body to a JSON object (stringified) containing the properties of the message.
The serializer is applied after this conversion:
Messages received from Kafka are transformed according to the deserializer of the bridge:
A message property key
is set on all messages which contain the Kafka key if set.