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.
MQTT messages arrive as JMS BytesMessage.
SwiftMQ to Kafka Transformation
Messages in the source queue or topic are converted into a Kafka record as follows:
BytesMessagebodies to a byte array.
TextMessagebodies to a string.
MapMessagebodies to a JSON object (stringified).
Messagewithout a body to a JSON object (stringified) containing the properties of the message.
The serializer is applied after this conversion:
Stringserializer creates a string from a byte array.
ByteArrayserializer creates a byte array from a string.
Kafka to SwiftMQ Transformation
Messages received from Kafka are transformed according to the deserializer of the bridge:
Stringcreates a JMS TextMessage and sets the body to a string.
ByteArraycreates a JMS BytesMessage and set the body to a byte array.
A message property
key is set on all messages which contain the Kafka key if set.