Interface KinesisToMqttTransformer
-
- 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 KinesisToMqttTransformer
Implement this transformer for the programmatic creation ofPublish
es fromInboundKinesisRecord
s. One instance of the implementing class is created per reference in the amazon-kinesis-configuration.xml. The methods of this interface may be called concurrently and must be thread-safe.Your implementation of the
KinesisToMqttTransformer
must be placed in a Java archive (.jar) together with all its dependencies in thecustomizations
folder of the "HiveMQ Enterprise Extension for Amazon Kinesis". In addition, a<transformer>
referencing the implementing class via its canonical name must be configured in theamazon-kinesis-configuration.xml
file.- Since:
- 4.14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
init(@NotNull KinesisToMqttInitInput kinesisToMqttInitInput)
Override the init method to initialize the transformer.void
transformKinesisToMqtt(@NotNull KinesisToMqttInput kinesisToMqttInput, @NotNull KinesisToMqttOutput kinesisToMqttOutput)
This callback is executed for everyInboundKinesisRecord
that the "HiveMQ Enterprise Extension for Amazon Kinesis" polls from Amazon Kinesis according to the configured<kinesis-streams>
in the<kinesis-to-mqtt-route>
tag.
-
-
-
Method Detail
-
init
default void init(@NotNull @NotNull KinesisToMqttInitInput kinesisToMqttInitInput)
Override the init method to initialize the transformer.- Parameters:
kinesisToMqttInitInput
- ThekinesisToMqttInitInput
- Since:
- 4.14.0
-
transformKinesisToMqtt
@ThreadSafe void transformKinesisToMqtt(@NotNull @NotNull KinesisToMqttInput kinesisToMqttInput, @NotNull @NotNull KinesisToMqttOutput kinesisToMqttOutput)
This callback is executed for everyInboundKinesisRecord
that the "HiveMQ Enterprise Extension for Amazon Kinesis" polls from Amazon Kinesis according to the configured<kinesis-streams>
in the<kinesis-to-mqtt-route>
tag. It allows the publication of any number ofPublish
es via theKinesisToMqttOutput
object. This method is called by multiple threads concurrently. Extensions are responsible for their own exception handling and this method must not throw anyException
.- Parameters:
kinesisToMqttInput
- TheKinesisToMqttInput
contains the triggeringInboundKinesisRecord
.kinesisToMqttOutput
- TheKinesisToMqttOutput
allows toKinesisToMqttOutput.setPublishes(java.util.List)
. If no output is set, an empty List is used as default and the Kinesis records will not be processed again, but ignored.- Since:
- 4.14.0
-
-