Package org.apache.activemq.artemis.reader

## Class MessageUtil

- java.lang.Object
- - org.apache.activemq.artemis.reader.MessageUtil

- Direct Known Subclasses:
    `BytesMessageUtil`, `MapMessageUtil`, `StreamMessageUtil`, `TextMessageUtil`

      public class MessageUtil
      extends java.lang.Object

  static methods intended for import static on JMS like messages. This provides a helper for core message to act some of the JMS functions used by the JMS wrapper

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static org.apache.activemq.artemis.api.core.SimpleString` | `CONNECTION_ID_PROPERTY_NAME` |
    `static java.lang.String` | `CONNECTION_ID_PROPERTY_NAME_STRING` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `CORRELATIONID_HEADER_NAME` |
    `static java.lang.String` | `CORRELATIONID_HEADER_NAME_STRING` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `JMS` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `JMS_` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `JMSX` |
    `static java.lang.String` | `JMSXDELIVERYCOUNT` |
    `static java.lang.String` | `JMSXGROUPID` |
    `static java.lang.String` | `JMSXGROUPSEQ` |
    `static java.lang.String` | `JMSXUSERID` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `REPLYTO_HEADER_NAME` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `TYPE_HEADER_NAME` |
    `static java.lang.String` | `TYPE_HEADER_NAME_STRING` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MessageUtil()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `clearProperties​(Message message)` |
    `static int` | `getIntProperty​(Message message, java.lang.String name)` |
    `static java.lang.String` | `getJMSCorrelationID​(Message message)` |
    `static byte[]` | `getJMSCorrelationIDAsBytes​(Message message)` |
    `static org.apache.activemq.artemis.api.core.SimpleString` | `getJMSReplyTo​(Message message)` |
    `static java.lang.String` | `getJMSType​(Message message)` |
    `static long` | `getLongProperty​(Message message, java.lang.String name)` |
    `static java.lang.Object` | `getObjectProperty​(Message message, java.lang.String name)` |
    `static java.util.Set<java.lang.String>` | `getPropertyNames​(Message message)` |
    `static java.lang.String` | `getStringProperty​(Message message, java.lang.String name)` |
    `static boolean` | `propertyExists​(Message message, java.lang.String name)` |
    `static void` | `setIntProperty​(Message message, java.lang.String name, int value)` |
    `static void` | `setJMSCorrelationID​(Message message, java.lang.String correlationID)` |
    `static void` | `setJMSCorrelationIDAsBytes​(Message message, byte[] correlationID)` |
    `static void` | `setJMSReplyTo​(Message message, java.lang.String dest)` |
    `static void` | `setJMSReplyTo​(Message message, org.apache.activemq.artemis.api.core.SimpleString dest)` |
    `static void` | `setJMSType​(Message message, java.lang.String type)` |
    `static void` | `setLongProperty​(Message message, java.lang.String name, long value)` |
    `static void` | `setObjectProperty​(Message message, java.lang.String name, java.lang.Object value)` |
    `static void` | `setStringProperty​(Message message, java.lang.String name, java.lang.String value)` |

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

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

- - ### Field Detail

    - #### CORRELATIONID_HEADER_NAME_STRING

          public static final java.lang.String CORRELATIONID_HEADER_NAME_STRING

      See Also:
        Constant Field Values

    - #### CORRELATIONID_HEADER_NAME

          public static final org.apache.activemq.artemis.api.core.SimpleString CORRELATIONID_HEADER_NAME

    - #### REPLYTO_HEADER_NAME

          public static final org.apache.activemq.artemis.api.core.SimpleString REPLYTO_HEADER_NAME

    - #### TYPE_HEADER_NAME_STRING

          public static final java.lang.String TYPE_HEADER_NAME_STRING

      See Also:
        Constant Field Values

    - #### TYPE_HEADER_NAME

          public static final org.apache.activemq.artemis.api.core.SimpleString TYPE_HEADER_NAME

    - #### JMS

          public static final org.apache.activemq.artemis.api.core.SimpleString JMS

    - #### JMSX

          public static final org.apache.activemq.artemis.api.core.SimpleString JMSX

    - #### JMS_

          public static final org.apache.activemq.artemis.api.core.SimpleString JMS_

    - #### JMSXDELIVERYCOUNT

          public static final java.lang.String JMSXDELIVERYCOUNT

      See Also:
        Constant Field Values

    - #### JMSXGROUPID

          public static final java.lang.String JMSXGROUPID

      See Also:
        Constant Field Values

    - #### JMSXGROUPSEQ

          public static final java.lang.String JMSXGROUPSEQ

      See Also:
        Constant Field Values

    - #### JMSXUSERID

          public static final java.lang.String JMSXUSERID

      See Also:
        Constant Field Values

    - #### CONNECTION_ID_PROPERTY_NAME_STRING

          public static final java.lang.String CONNECTION_ID_PROPERTY_NAME_STRING

      See Also:
        Constant Field Values

    - #### CONNECTION_ID_PROPERTY_NAME

          public static final org.apache.activemq.artemis.api.core.SimpleString CONNECTION_ID_PROPERTY_NAME

  - ### Constructor Detail

    - #### MessageUtil

          public MessageUtil()

  - ### Method Detail

    - #### getJMSCorrelationIDAsBytes

          public static byte[] getJMSCorrelationIDAsBytes​(Message message)

    - #### setJMSType

          public static void setJMSType​(Message message,
                                        java.lang.String type)

    - #### getJMSType

          public static java.lang.String getJMSType​(Message message)

    - #### setJMSCorrelationIDAsBytes

          public static final void setJMSCorrelationIDAsBytes​(Message message,
                                                              byte[] correlationID)
                                                       throws org.apache.activemq.artemis.api.core.ActiveMQException

      Throws:
        `org.apache.activemq.artemis.api.core.ActiveMQException`

    - #### setJMSCorrelationID

          public static void setJMSCorrelationID​(Message message,
                                                 java.lang.String correlationID)

    - #### getJMSCorrelationID

          public static java.lang.String getJMSCorrelationID​(Message message)

    - #### getJMSReplyTo

          public static org.apache.activemq.artemis.api.core.SimpleString getJMSReplyTo​(Message message)

    - #### setJMSReplyTo

          public static void setJMSReplyTo​(Message message,
                                           java.lang.String dest)

    - #### setJMSReplyTo

          public static void setJMSReplyTo​(Message message,
                                           org.apache.activemq.artemis.api.core.SimpleString dest)

    - #### clearProperties

          public static void clearProperties​(Message message)

    - #### getPropertyNames

          public static java.util.Set<java.lang.String> getPropertyNames​(Message message)

    - #### propertyExists

          public static boolean propertyExists​(Message message,
                                               java.lang.String name)

    - #### getStringProperty

          public static java.lang.String getStringProperty​(Message message,
                                                           java.lang.String name)

    - #### getObjectProperty

          public static java.lang.Object getObjectProperty​(Message message,
                                                           java.lang.String name)

    - #### getLongProperty

          public static long getLongProperty​(Message message,
                                             java.lang.String name)

    - #### getIntProperty

          public static int getIntProperty​(Message message,
                                           java.lang.String name)

    - #### setIntProperty

          public static void setIntProperty​(Message message,
                                            java.lang.String name,
                                            int value)

    - #### setLongProperty

          public static void setLongProperty​(Message message,
                                             java.lang.String name,
                                             long value)

    - #### setStringProperty

          public static void setStringProperty​(Message message,
                                               java.lang.String name,
                                               java.lang.String value)

    - #### setObjectProperty

          public static void setObjectProperty​(Message message,
                                               java.lang.String name,
                                               java.lang.Object value)