Enum MessageFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MessageFormat>

    public enum MessageFormat
    extends java.lang.Enum<MessageFormat>
    Identifies the format used to encode or decode messages.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      V1
      String representation of the message only contains the message payload; no header attributes supported.
      V2
      String representation of the message contains version, header attributes and payload in JSON format
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MessageFormat defaultMessageFormat()
      Returns the default message format used by Synapse to encode messages.
      static MessageFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MessageFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      static MessageFormat versionOf​(java.lang.String message)
      Determines the MessageFormat from the string representation of some message.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • V1

        public static final MessageFormat V1
        String representation of the message only contains the message payload; no header attributes supported.
      • V2

        public static final MessageFormat V2
        String representation of the message contains version, header attributes and payload in JSON format
    • Field Detail

      • SYNAPSE_MSG_FORMAT

        public static final java.lang.String SYNAPSE_MSG_FORMAT
        See Also:
        Constant Field Values
      • SYNAPSE_MSG_COMPACTIONKEY

        public static final java.lang.String SYNAPSE_MSG_COMPACTIONKEY
        See Also:
        Constant Field Values
      • SYNAPSE_MSG_PARTITIONKEY

        public static final java.lang.String SYNAPSE_MSG_PARTITIONKEY
        See Also:
        Constant Field Values
      • SYNAPSE_MSG_HEADERS

        public static final java.lang.String SYNAPSE_MSG_HEADERS
        See Also:
        Constant Field Values
      • SYNAPSE_MSG_PAYLOAD

        public static final java.lang.String SYNAPSE_MSG_PAYLOAD
        See Also:
        Constant Field Values
    • Method Detail

      • values

        public static MessageFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MessageFormat c : MessageFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MessageFormat valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • defaultMessageFormat

        public static MessageFormat defaultMessageFormat()
        Returns the default message format used by Synapse to encode messages.
        Returns:
        the default message format
      • versionOf

        public static MessageFormat versionOf​(java.lang.String message)
        Determines the MessageFormat from the string representation of some message.
        Parameters:
        message - the string representation of some message
        Returns:
        MessageFormat of the message