Interface MqttToKafkaOutput
-
@DoNotImplement public interface MqttToKafkaOutput
The output parameter of theMqttToKafkaTransformer. It allows access to theKafkaRecordBuilder.After the
MqttToKafkaTransformer.transformMqttToKafka(MqttToKafkaInput, MqttToKafkaOutput)method returns theKafkaRecords given to this output will be published to the associated Kafka cluster by the HiveMQ Enterprise Extension for Kafka.- Since:
- 4.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull KafkaRecordBuildernewKafkaRecordBuilder()Create a newKafkaRecordBuilder.voidsetKafkaRecords(@NotNull List<@NotNull KafkaRecord> kafkaRecords)Sets theKafkaRecords, that will be pushed to the associated Kafka cluster after theMqttToKafkaTransformer.transformMqttToKafka(MqttToKafkaInput, MqttToKafkaOutput)call returns.
-
-
-
Method Detail
-
newKafkaRecordBuilder
@NotNull @NotNull KafkaRecordBuilder newKafkaRecordBuilder()
Create a newKafkaRecordBuilder. OneKafkaRecordBuildercan be used to build multiple Kafka records.- Returns:
- an empty instance of the
KafkaRecordBuilder. - Since:
- 4.4.0
-
setKafkaRecords
void setKafkaRecords(@NotNull @NotNull List<@NotNull KafkaRecord> kafkaRecords)
Sets theKafkaRecords, that will be pushed to the associated Kafka cluster after theMqttToKafkaTransformer.transformMqttToKafka(MqttToKafkaInput, MqttToKafkaOutput)call returns. The HiveMQ Enterprise Extension for Kafka will publish these records in the order provided by thekafkaRecordsargument.If desired, the same record can occupy multiple places in the
kafkaRecordslist. When no record shall be pushed to the associated Kafka cluster for aPublishPacket, call this method with an empty list.Use the
KafkaRecordBuilderto create new records as desired.Each additional call of this method will overwrite the previous one.
- Parameters:
kafkaRecords- a list of to be publishedKafkaRecords.- Throws:
NullPointerException- ifkafkaRecordsor any element of it is null.IllegalArgumentException- if any element inkafkaRecordswas not created via aKafkaRecordBuilder.- Since:
- 4.4.0
-
-