Interface KafkaToMqttTransformer
-
- All Superinterfaces:
Transformer<KafkaToMqttInitInput>
- 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 KafkaToMqttTransformer extends Transformer<KafkaToMqttInitInput>
Implement this transformer for the programmatic creation ofPublishesfromKafkaRecords. One instance of the implementing class is created per reference in the kafka-configuration.xml. The methods of this interface may be called concurrently and must be thread-safe.Your implementation of the KafkaToMqttTransformer must be placed in a Java archive (.jar) together with all its dependencies in the
customizationsfolder of the "HiveMQ Enterprise Extension for Kafka". In addition, a<kafka-to-mqtt-transformer>referencing the implementing class via its canonical name must be configured in thekafka-extension.xmlfile.- Since:
- 4.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidtransformKafkaToMqtt(@NotNull KafkaToMqttInput input, @NotNull KafkaToMqttOutput output)This callback is executed for everyKafkaRecordthat the "HiveMQ Enterprise Extension for Kafka" polls from Kafka according to the configured<kafka-topics>in the<kafka-to-mqtt-transformer>tag.-
Methods inherited from interface com.hivemq.extensions.kafka.api.transformers.Transformer
init
-
-
-
-
Method Detail
-
transformKafkaToMqtt
@ThreadSafe void transformKafkaToMqtt(@NotNull @NotNull KafkaToMqttInput input, @NotNull @NotNull KafkaToMqttOutput output)
This callback is executed for everyKafkaRecordthat the "HiveMQ Enterprise Extension for Kafka" polls from Kafka according to the configured<kafka-topics>in the<kafka-to-mqtt-transformer>tag.It allows the publication of any number of
Publishesvia theKafkaToMqttOutputobject. This method is called by multiple threads concurrently. Extensions are responsible for their own exception handling and this method must not throw anyException.- Parameters:
input- TheKafkaToMqttInputcontains the triggeringKafkaRecordand theKafkaClusterinformation.output- TheKafkaToMqttOutputallows toprovide a list of Publishes. If no output is set, an empty List is used as default and the kafka record will not be processed again, but ignored.- Since:
- 4.5.0
-
-