Class AmqpCodec


  • public final class AmqpCodec
    extends Object
    AMQP Codec class used to hide the details of encode / decode
    • Constructor Summary

      Constructors 
      Constructor Description
      AmqpCodec()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.qpid.proton.amqp.messaging.Section decode​(io.netty.buffer.ByteBuf encoded)
      Given an encoded AMQP Section, decode the value previously written there.
      static AmqpJmsMessageFacade decodeMessage​(AmqpConsumer consumer, org.apache.qpid.proton.codec.ReadableBuffer messageBytes)
      Create a new JmsMessage and underlying JmsMessageFacade that represents the proper message type for the incoming AMQP message.
      static io.netty.buffer.ByteBuf encode​(org.apache.qpid.proton.amqp.messaging.Section section)
      Given an AMQP Section encode it and return the buffer holding the encoded value
      static io.netty.buffer.ByteBuf encodeMessage​(AmqpJmsMessageFacade message)
      Given a Message instance, encode the Message to the wire level representation of that Message.
      static org.apache.qpid.proton.codec.DecoderImpl getDecoder()  
      static org.apache.qpid.proton.codec.EncoderImpl getEncoder()  
    • Constructor Detail

      • AmqpCodec

        public AmqpCodec()
    • Method Detail

      • getEncoder

        public static org.apache.qpid.proton.codec.EncoderImpl getEncoder()
        Returns:
        a Encoder instance.
      • getDecoder

        public static org.apache.qpid.proton.codec.DecoderImpl getDecoder()
        Returns:
        a Decoder instance.
      • encode

        public static io.netty.buffer.ByteBuf encode​(org.apache.qpid.proton.amqp.messaging.Section section)
        Given an AMQP Section encode it and return the buffer holding the encoded value
        Parameters:
        section - the AMQP Section value to encode.
        Returns:
        a buffer holding the encoded bytes of the given AMQP Section object.
      • decode

        public static org.apache.qpid.proton.amqp.messaging.Section decode​(io.netty.buffer.ByteBuf encoded)
        Given an encoded AMQP Section, decode the value previously written there.
        Parameters:
        encoded - the AMQP Section value to decode.
        Returns:
        a Section object read from its encoded form.
      • encodeMessage

        public static io.netty.buffer.ByteBuf encodeMessage​(AmqpJmsMessageFacade message)
        Given a Message instance, encode the Message to the wire level representation of that Message.
        Parameters:
        message - the Message that is to be encoded into the wire level representation.
        Returns:
        a buffer containing the wire level representation of the input Message.
      • decodeMessage

        public static AmqpJmsMessageFacade decodeMessage​(AmqpConsumer consumer,
                                                         org.apache.qpid.proton.codec.ReadableBuffer messageBytes)
                                                  throws IOException
        Create a new JmsMessage and underlying JmsMessageFacade that represents the proper message type for the incoming AMQP message.
        Parameters:
        consumer - The AmqpConsumer instance that will be linked to the decoded message.
        messageBytes - The the raw bytes that compose the incoming message. (Read-Only)
        Returns:
        a AmqpJmsMessageFacade instance decoded from the message bytes.
        Throws:
        IOException - if an error occurs while creating the message objects.