Interface MqttToKafkaTransformer
-
- All Superinterfaces:
Transformer<MqttToKafkaInitInput>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MqttToKafkaTransformer extends Transformer<MqttToKafkaInitInput>
Implement this transformer for the programmatic creation ofKafkaRecord
s fromPublishPacket
s.Your implementation of the MqttToKafkaTransformer must be placed in a java archive (.jar) together with all its dependencies in the
customizations
folder of the "HiveMQ Enterprise Extension for Kafka". In addition, a<mqtt-to-kafka-transformer>
referencing the implementing class via its canonical name must be configured in thekafka-extension.xml
file.- Since:
- 4.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
transformMqttToKafka(@NotNull MqttToKafkaInput input, @NotNull MqttToKafkaOutput output)
This callback is executed for every MQTT PUBLISH that arrives at your HiveMQ cluster matching the in the<mqtt-to-kafka-transformer>
tag configured<mqtt-topic-filters>
.-
Methods inherited from interface com.hivemq.extensions.kafka.api.transformers.Transformer
init
-
-
-
-
Method Detail
-
transformMqttToKafka
void transformMqttToKafka(@NotNull @NotNull MqttToKafkaInput input, @NotNull @NotNull MqttToKafkaOutput output)
This callback is executed for every MQTT PUBLISH that arrives at your HiveMQ cluster matching the in the<mqtt-to-kafka-transformer>
tag configured<mqtt-topic-filters>
. It allows the publication of any number ofKafkaRecord
s via theMqttToKafkaOutput
object.- Parameters:
input
- TheMqttToKafkaInput
contains the triggeringPublishPacket
and theKafkaCluster
information. TheKafkaTopicService
can be accessed.output
- Pass the list of newKafkaRecord
s to theMqttToKafkaOutput.setKafkaRecords(List)
method.- Since:
- 4.4.0
-
-