public class CustomMessageMapper extends Object implements MqttMessageMapper
Given a topic name: “users/{user}/{location}/{deviceId}” and a payload of “{temperature}/{humidity}” emits a tuple containing user(String), deviceId(String), location(String), temperature(float), humidity(float)
Constructor and Description |
---|
CustomMessageMapper() |
Modifier and Type | Method and Description |
---|---|
Fields |
outputFields()
Returns the list of output fields this Mapper produces.
|
Values |
toValues(MqttMessage message)
Convert a
MqttMessage to a set of Values that can be emitted as a Storm Tuple. |
public Values toValues(MqttMessage message)
MqttMessageMapper
Convert a MqttMessage
to a set of Values that can be emitted as a Storm Tuple.
toValues
in interface MqttMessageMapper
message
- An MQTT Message.public Fields outputFields()
MqttMessageMapper
Returns the list of output fields this Mapper produces.
outputFields
in interface MqttMessageMapper
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.