org.apache.storm.mqtt.mappers

## Class StringMessageMapper

- java.lang.Object
- - org.apache.storm.mqtt.mappers.StringMessageMapper

- All Implemented Interfaces:
    Serializable, MqttMessageMapper

      public class StringMessageMapper
      extends Object
      implements MqttMessageMapper

  Given a String topic and byte[] message, emits a tuple with fields “topic” and “message”, both of which are Strings.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringMessageMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StringMessageMapper

          public StringMessageMapper()

  - ### Method Detail

    - #### toValues

          public Values toValues(MqttMessage message)

      Description copied from interface: `MqttMessageMapper`

      Convert a `MqttMessage` to a set of Values that can be emitted as a Storm Tuple.

      Specified by:
        `toValues` in interface `MqttMessageMapper`
      Parameters:
        `message` - An MQTT Message.
      Returns:
        Values representing a Storm Tuple.

    - #### outputFields

          public Fields outputFields()

      Description copied from interface: `MqttMessageMapper`

      Returns the list of output fields this Mapper produces.

      Specified by:
        `outputFields` in interface `MqttMessageMapper`
      Returns:
        the list of output fields this mapper produces.

Copyright © 2021 The Apache Software Foundation. All rights reserved.