Interface ConsumedDataReceiver<MESSAGE>
-
- Type Parameters:
MESSAGE
- Type of consumed data. For example, in the Kafka case, this type could beConsumerRecords
- All Known Implementing Classes:
StorePartitionDataReceiver
public interface ConsumedDataReceiver<MESSAGE>
An abstraction of a receiver of data consumed from a message queue. In other words, its an abstraction that accepts data consumed from a message queue. Note that it is NOT thread-safe. This abstraction may be converted to a more explicit partition buffer interface when we introduce the partition buffer interface to avoid potential confusion.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PubSubTopic
destinationIdentifier()
N.B.: Used for defensive coding.void
notifyOfTopicDeletion(java.lang.String topicName)
void
write(MESSAGE consumedData)
This method accepts data consumed from a queue and it should be non-blocking.
-
-
-
Method Detail
-
write
void write(MESSAGE consumedData) throws java.lang.Exception
This method accepts data consumed from a queue and it should be non-blocking. This method may throw an exception if write is not successful. No exception being thrown means write is successful.- Parameters:
consumedData
- Consumed data.- Throws:
java.lang.Exception
-
destinationIdentifier
PubSubTopic destinationIdentifier()
N.B.: Used for defensive coding. Today, this is exclusively used to return the version-topic name. If this is to be expanded to other usages in the future, we should consider carefully if it needs refactoring.- Returns:
- an identifier of where the data is going.
-
notifyOfTopicDeletion
void notifyOfTopicDeletion(java.lang.String topicName)
-
-