Class ChannelMessageConsumerImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.ChannelMessageConsumerImpl
- All Implemented Interfaces:
ChannelMessageConsumer
A basic implementation of the
ChannelMessageConsumer interface-
Constructor Summary
ConstructorsConstructorDescriptionChannelMessageConsumerImpl(RoutingKeyParser routingKeyParser, SdkInternalConfiguration configuration, SdkProducerManager producerManager, JAXBContext messageJaxbContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the channel and does the resource cleanupvoidonMessageReceived(String routingKey, byte[] body, com.rabbitmq.client.AMQP.BasicProperties properties, long receivedAt) Consumes the provided message payloadvoidopen(MessageConsumer messageConsumer) Opens the channel message consumer and prepares the required instances
-
Constructor Details
-
ChannelMessageConsumerImpl
@Inject public ChannelMessageConsumerImpl(RoutingKeyParser routingKeyParser, SdkInternalConfiguration configuration, SdkProducerManager producerManager, JAXBContext messageJaxbContext) - Parameters:
routingKeyParser- aRoutingKeyParserused to parse the rabbit's routing keyconfiguration- the associated feed configurationproducerManager- the producer manager
-
-
Method Details
-
open
Opens the channel message consumer and prepares the required instances- Specified by:
openin interfaceChannelMessageConsumer- 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:
onMessageReceivedin interfaceChannelMessageConsumer- Parameters:
routingKey- - the source routing key of the payloadbody- - the message payloadproperties- - the BasicProperties associated to the messagereceivedAt- - the time when message was received (in milliseconds since EPOCH UTC)
-
getConsumerDescription
- Specified by:
getConsumerDescriptionin interfaceChannelMessageConsumer
-
close
Description copied from interface:ChannelMessageConsumerCloses the channel and does the resource cleanup- Specified by:
closein interfaceChannelMessageConsumer- Throws:
IOException
-