public class MigratoryDataKafkaUtils extends Object
| Constructor and Description |
|---|
MigratoryDataKafkaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
int partition,
long timestamp,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record with a specified timestamp to be sent to a specified topic and partition, with customizable quality of service, compression, and retention options for MigratoryData
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
int partition,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record to be sent to a specified topic and partition, with customizable quality of service, compression, and retention options for MigratoryData
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record to be sent to a specified topic, with customizable quality of service, compression, and retention options for MigratoryData
|
static byte[] |
getRecordValue(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record)
Get the content of a Kafka record corresponding to a MigratoryData message
|
public static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended tokey - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, int partition, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended topartition - The partition to which the record should be sentkey - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, int partition, long timestamp, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended topartition - The partition to which the record should be senttimestamp - The timestamp of the record, in milliseconds since epoch. If null, the producer will assign the timestamp using System.currentTimeMillis().key - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static byte[] getRecordValue(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record)
record - A Kafka recordCopyright © 2023. All rights reserved.