Interface MessageConsumer
- All Known Implementing Classes:
UofSessionImpl
public interface MessageConsumer
Defines methods implemented by classes that can consume messages
-
Method Summary
Modifier and TypeMethodDescriptionReturns aStringwhich describes the consumerReturns the consumerMessageInterest(method most useful in custom consumer implementations)voidonMessageDeserializationFailed(byte[] rawMessage, Urn eventId) Dispatches the "unparsable message received event"voidonMessageReceived(UnmarshalledMessage unmarshalledMessage, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Consumes the provided messagevoidonRawFeedMessageReceived(RoutingKeyInfo routingKey, UnmarshalledMessage feedMessage, MessageTimestamp timestamp, MessageInterest messageInterest) Occurs when any feed message arrives
-
Method Details
-
onMessageReceived
void onMessageReceived(UnmarshalledMessage unmarshalledMessage, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Consumes the provided message- Parameters:
unmarshalledMessage- - an unmarshalled message payloadbody- - the raw payload (mainly used for logging and user exposure)routingKeyInfo- - aRoutingKeyInfoinstance describing the message routing keytimestamp- - all message timestamps
-
onMessageDeserializationFailed
Dispatches the "unparsable message received event"- Parameters:
rawMessage- - the raw message payloadeventId- - if available the related sport event id; otherwise null
-
getConsumerDescription
String getConsumerDescription()Returns aStringwhich describes the consumer- Returns:
- - a
Stringwhich describes the consumer
-
getMessageInterest
MessageInterest getMessageInterest()Returns the consumerMessageInterest(method most useful in custom consumer implementations)- Returns:
- the consumer
MessageInterest
-
onRawFeedMessageReceived
void onRawFeedMessageReceived(RoutingKeyInfo routingKey, UnmarshalledMessage feedMessage, MessageTimestamp timestamp, MessageInterest messageInterest) Occurs when any feed message arrives- Parameters:
routingKey- the routing key associated with this messagefeedMessage- the message receivedtimestamp- the message timestampsmessageInterest- the associatedMessageInterest
-