Search in sources :

Example 11 with ApplicationProperties

use of com.swiftmq.amqp.v100.generated.messaging.message_format.ApplicationProperties in project rabbitmq-stream-java-client by rabbitmq.

the class SwiftMqCodec method createMessage.

protected Message createMessage(byte[] data) {
    AMQPMessage amqpMessage;
    try {
        amqpMessage = new AMQPMessage(data);
    } catch (Exception e) {
        throw new StreamException("Error while decoding AMQP 1.0 message");
    }
    Object body = extractBody(amqpMessage);
    com.rabbitmq.stream.Properties properties = createProperties(amqpMessage);
    Map<String, Object> applicationProperties = createApplicationProperties(amqpMessage);
    Map<String, Object> messageAnnotations = createMessageAnnotations(amqpMessage);
    return new SwiftMqMessage(amqpMessage, body, properties, applicationProperties, messageAnnotations);
}
Also used : AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage) IOException(java.io.IOException) StreamException(com.rabbitmq.stream.StreamException) StreamException(com.rabbitmq.stream.StreamException)

Aggregations

AMQPMessage (com.swiftmq.amqp.v100.messaging.AMQPMessage)10 Map (java.util.Map)9 HashMap (java.util.HashMap)7 ApplicationProperties (com.swiftmq.amqp.v100.generated.messaging.message_format.ApplicationProperties)6 AMQPString (com.swiftmq.amqp.v100.types.AMQPString)6 Properties (com.swiftmq.amqp.v100.generated.messaging.message_format.Properties)4 AMQPBoolean (com.swiftmq.amqp.v100.types.AMQPBoolean)4 AMQPMap (com.swiftmq.amqp.v100.types.AMQPMap)4 AMQPException (com.swiftmq.amqp.v100.client.AMQPException)3 IOException (java.io.IOException)3 JMSException (javax.jms.JMSException)3 StreamException (com.rabbitmq.stream.StreamException)2 SequenceNo (com.swiftmq.amqp.v100.generated.transport.definitions.SequenceNo)2 AMQPInt (com.swiftmq.amqp.v100.types.AMQPInt)2 MessageImpl (com.swiftmq.jms.MessageImpl)2 com.rabbitmq.stream.amqp (com.rabbitmq.stream.amqp)1 com.swiftmq.amqp.v100.generated.messaging.message_format (com.swiftmq.amqp.v100.generated.messaging.message_format)1 AmqpValue (com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)1 Milliseconds (com.swiftmq.amqp.v100.generated.transport.definitions.Milliseconds)1 DataByteArrayOutputStream (com.swiftmq.tools.util.DataByteArrayOutputStream)1