Class ChannelMessageConsumerImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.ChannelMessageConsumerImpl
All Implemented Interfaces:
ChannelMessageConsumer

public class ChannelMessageConsumerImpl extends Object implements ChannelMessageConsumer
A basic implementation of the ChannelMessageConsumer interface
  • Constructor Details

  • Method Details

    • open

      public void open(MessageConsumer messageConsumer)
      Opens the channel message consumer and prepares the required instances
      Specified by:
      open in interface ChannelMessageConsumer
      Parameters:
      messageConsumer - the parsed/prepared messages
    • onMessageReceived

      public void onMessageReceived(String routingKey, byte[] body, com.rabbitmq.client.AMQP.BasicProperties properties, long receivedAt)
      Consumes the provided message payload
      Specified by:
      onMessageReceived in interface ChannelMessageConsumer
      Parameters:
      routingKey - - the source routing key of the payload
      body - - the message payload
      properties - - the BasicProperties associated to the message
      receivedAt - - the time when message was received (in milliseconds since EPOCH UTC)
    • getConsumerDescription

      public String getConsumerDescription()
      Specified by:
      getConsumerDescription in interface ChannelMessageConsumer
    • close

      public void close() throws IOException
      Description copied from interface: ChannelMessageConsumer
      Closes the channel and does the resource cleanup
      Specified by:
      close in interface ChannelMessageConsumer
      Throws:
      IOException