Interface MqttToKafkaOutput
-
@DoNotImplement public interface MqttToKafkaOutput
The output parameter of theMqttToKafkaTransformer
. It allows access to theKafkaRecordBuilder
.After the
MqttToKafkaTransformer.transformMqttToKafka(MqttToKafkaInput, MqttToKafkaOutput)
method returns theKafkaRecord
s 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 KafkaRecordBuilder
newKafkaRecordBuilder()
Create a newKafkaRecordBuilder
.void
setKafkaRecords(@NotNull List<@NotNull KafkaRecord> kafkaRecords)
Sets theKafkaRecord
s, 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
. OneKafkaRecordBuilder
can 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 theKafkaRecord
s, 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 thekafkaRecords
argument.If desired, the same record can occupy multiple places in the
kafkaRecords
list. When no record shall be pushed to the associated Kafka cluster for aPublishPacket
, call this method with an empty list.Use the
KafkaRecordBuilder
to create new records as desired.Each additional call of this method will overwrite the previous one.
- Parameters:
kafkaRecords
- A list of to be publishedKafkaRecord
s.- Throws:
NullPointerException
- IfkafkaRecords
or any element of it is null.IllegalArgumentException
- If any element inkafkaRecords
was not created via aKafkaRecordBuilder
.- Since:
- 4.4.0
-
-