public class JSONMessage extends Object implements MessageType<Integer,String>
| Constructor and Description |
|---|
JSONMessage()
Instantiates a new Json message.
|
JSONMessage(Integer id,
String body)
Instantiates a new Json message.
|
| Modifier and Type | Method and Description |
|---|---|
MessageType |
buildConsumerMessage(org.apache.kafka.clients.consumer.ConsumerRecord<Integer,String> record,
Integer key,
String body)
Build message while consuming the message
for your specific needs Refer io.virtualan.cucumblan.message.typeimpl.JSONMessage
|
MessageType |
buildProducerMessage(Object messages)
Build message object build logic for the application specific need.
|
List<org.apache.kafka.common.header.Header> |
getHeaders()
Kafka message headers to be added to produce messages
|
Integer |
getId()
Gets unique identifier of the message
|
Integer |
getKey()
Gets Kafka message key for kafka
|
String |
getMessage()
Gets Kafka message to be used for Kafka
|
org.json.JSONObject |
getMessageAsJson()
Mandatory JSON Should be defined and Used for Verification process.
|
String |
getType()
define a unique type of the message would be used.
|
String |
toString() |
public String getType()
MessageTypegetType in interface MessageType<Integer,String>public List<org.apache.kafka.common.header.Header> getHeaders()
MessageTypegetHeaders in interface MessageType<Integer,String>public Integer getId()
MessageTypegetId in interface MessageType<Integer,String>public Integer getKey()
MessageTypegetKey in interface MessageType<Integer,String>public String getMessage()
MessageTypegetMessage in interface MessageType<Integer,String>public org.json.JSONObject getMessageAsJson()
MessageTypegetMessageAsJson in interface MessageType<Integer,String>public MessageType buildProducerMessage(Object messages) throws MessageNotDefinedException
MessageTypebuildProducerMessage in interface MessageType<Integer,String>messages - the ttMessageNotDefinedExceptionpublic MessageType buildConsumerMessage(org.apache.kafka.clients.consumer.ConsumerRecord<Integer,String> record, Integer key, String body) throws MessageNotDefinedException
MessageTypebuildConsumerMessage in interface MessageType<Integer,String>record - ConsumerRecord object available in the contextkey - the kafka message keybody - the kafka message objectMessageNotDefinedException - the message not defined exceptionCopyright © 2021. All rights reserved.