org.apache.storm.rocketmq

## Class DefaultMessageBodySerializer

- java.lang.Object
- - org.apache.storm.rocketmq.DefaultMessageBodySerializer

- All Implemented Interfaces:
    Serializable, MessageBodySerializer

      public class DefaultMessageBodySerializer
      extends Object
      implements MessageBodySerializer

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMessageBodySerializer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `serialize(Object body)` Currently, we just convert string to bytes using UTF-8 charset.

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

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

- - ### Constructor Detail

    - #### DefaultMessageBodySerializer

          public DefaultMessageBodySerializer()

  - ### Method Detail

    - #### serialize

          public byte[] serialize(Object body)

      Currently, we just convert string to bytes using UTF-8 charset. Note: in this way, object.toString() method is invoked.

      Specified by:
        `serialize` in interface `MessageBodySerializer`
      Parameters:
        `body` - RocketMQ Message body
      Returns:
        serialized byte array

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