public class ChannelMessageConsumerImpl extends Object implements ChannelMessageConsumer
ChannelMessageConsumer
interfaceConstructor and Description |
---|
ChannelMessageConsumerImpl(RoutingKeyParser routingKeyParser,
SdkInternalConfiguration configuration,
SdkProducerManager producerManager,
JAXBContext messageJaxbContext) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the channel and does the resource cleanup
|
String |
getConsumerDescription() |
void |
onMessageReceived(String routingKey,
byte[] body,
com.rabbitmq.client.AMQP.BasicProperties properties,
long receivedAt)
Consumes the provided message payload
|
void |
open(MessageConsumer messageConsumer)
Opens the channel message consumer and prepares the required instances
|
@Inject public ChannelMessageConsumerImpl(RoutingKeyParser routingKeyParser, SdkInternalConfiguration configuration, SdkProducerManager producerManager, JAXBContext messageJaxbContext)
routingKeyParser
- a RoutingKeyParser
used to parse the rabbit's routing keyconfiguration
- the associated feed configurationproducerManager
- the producer managerpublic void open(MessageConsumer messageConsumer)
open
in interface ChannelMessageConsumer
messageConsumer
- the parsed/prepared messagespublic void onMessageReceived(String routingKey, byte[] body, com.rabbitmq.client.AMQP.BasicProperties properties, long receivedAt)
onMessageReceived
in interface ChannelMessageConsumer
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)public String getConsumerDescription()
getConsumerDescription
in interface ChannelMessageConsumer
public void close() throws IOException
ChannelMessageConsumer
close
in interface ChannelMessageConsumer
IOException
Copyright © 2016–2025. All rights reserved.