org.apache.activemq.artemis.api.core.client

## Interface ClientMessage

- All Superinterfaces:
    Message

      public interface ClientMessage
      extends Message

  A ClientMessage represents a message sent and/or received by ActiveMQ Artemis.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.activemq.artemis.api.core.Message

      `BYTES_TYPE, DEFAULT_TYPE, HDR_ACTUAL_EXPIRY_TIME, HDR_DUPLICATE_DETECTION_ID, HDR_GROUP_ID, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIGINAL_ADDRESS, HDR_ORIGINAL_QUEUE, HDR_SCHEDULED_DELIVERY_TIME, MAP_TYPE, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientMessage` | `acknowledge()` Acknowledges reception of this message.
    `void` | `checkCompletion()` This can be optionally used to verify if the entire message has been received.
    `int` | `getBodySize()` Returns the size (in bytes) of this message's body
    `int` | `getDeliveryCount()` Returns the number of times this message was delivered.
    `ClientMessage` | `individualAcknowledge()` Acknowledges reception of a single message.
    `ClientMessage` | `putBooleanProperty(SimpleString key, boolean value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putBooleanProperty(String key, boolean value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putByteProperty(SimpleString key, byte value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putByteProperty(String key, byte value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putBytesProperty(SimpleString key, byte[] value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putBytesProperty(String key, byte[] value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putCharProperty(SimpleString key, char value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putCharProperty(String key, char value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putDoubleProperty(SimpleString key, double value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putDoubleProperty(String key, double value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putFloatProperty(SimpleString key, float value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putFloatProperty(String key, float value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putIntProperty(SimpleString key, int value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putIntProperty(String key, int value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putLongProperty(SimpleString key, long value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putLongProperty(String key, long value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putShortProperty(SimpleString key, short value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putShortProperty(String key, short value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putStringProperty(SimpleString key, SimpleString value)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `putStringProperty(String key, String value)` Overridden from `Message` to enable fluent API
    `void` | `saveToOutputStream(OutputStream out)` Saves the content of the message to the OutputStream.
    `ClientMessage` | `setBodyInputStream(InputStream bodyInputStream)` Sets the body's IntputStream.
    `ClientMessage` | `setDeliveryCount(int deliveryCount)` Sets the delivery count for this message.
    `ClientMessage` | `setOutputStream(OutputStream out)` Sets the OutputStream that will receive the content of a message received in a non blocking way.
    `boolean` | `waitOutputStreamCompletion(long timeMilliseconds)` Wait the outputStream completion of the message.
    `ClientMessage` | `writeBodyBufferBytes(byte[] bytes)` Overridden from `Message` to enable fluent API
    `ClientMessage` | `writeBodyBufferString(String string)` Overridden from `Message` to enable fluent API

    - ### Methods inherited from interface org.apache.activemq.artemis.api.core.Message

      `containsProperty, containsProperty, getAddress, getBodyBuffer, getBodyBufferCopy, getBooleanProperty, getBooleanProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getDoubleProperty, getDoubleProperty, getEncodeSize, getExpiration, getFloatProperty, getFloatProperty, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getMessageID, getObjectProperty, getObjectProperty, getPriority, getPropertyNames, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, isDurable, isExpired, isLargeMessage, putObjectProperty, putObjectProperty, removeProperty, removeProperty, setAddress, setDurable, setExpiration, setPriority, setTimestamp, setUserID, toMap`

- - ### Method Detail

    - #### getDeliveryCount

          int getDeliveryCount()

      Returns the number of times this message was delivered.

    - #### setDeliveryCount

          ClientMessage setDeliveryCount(int deliveryCount)

      Sets the delivery count for this message.

      This method is not meant to be called by ActiveMQ Artemis clients.

      Parameters:
        `deliveryCount` - message delivery count
      Returns:
        this ClientMessage

    - #### acknowledge

          ClientMessage acknowledge()
                             throws ActiveMQException

      Acknowledges reception of this message.

      If the session responsible to acknowledge this message has `autoCommitAcks` set to `true`, the transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be committed until the client commits the session transaction.

      Throws:
        `ActiveMQException` - if an error occurred while acknowledging the message.
      See Also:
        `ClientSession.isAutoCommitAcks()`

    - #### individualAcknowledge

          ClientMessage individualAcknowledge()
                                       throws ActiveMQException

      Acknowledges reception of a single message.

      If the session responsible to acknowledge this message has `autoCommitAcks` set to `true`, the transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be committed until the client commits the session transaction.

      Throws:
        `ActiveMQException` - if an error occurred while acknowledging the message.
      See Also:
        `ClientSession.isAutoCommitAcks()`

    - #### checkCompletion

          void checkCompletion()
                        throws ActiveMQException

      This can be optionally used to verify if the entire message has been received. It won't have any effect on regular messages but it may be helpful on large messages. The use case for this is to make sure there won't be an exception while getting the buffer. Using getBodyBuffer directly would have the same effect but you could get a Runtime non checked Exception instead
      Throws:
        `ActiveMQException`

    - #### getBodySize

          int getBodySize()

      Returns the size (in bytes) of this message's body

    - #### setOutputStream

          ClientMessage setOutputStream(OutputStream out)
                                 throws ActiveMQException

      Sets the OutputStream that will receive the content of a message received in a non blocking way.
      This method is used when consuming large messages
      Returns:
        this ClientMessage
      Throws:
        `ActiveMQException`

    - #### saveToOutputStream

          void saveToOutputStream(OutputStream out)
                           throws ActiveMQException

      Saves the content of the message to the OutputStream. It will block until the entire content is transferred to the OutputStream.
      Throws:
        `ActiveMQException`

    - #### waitOutputStreamCompletion

          boolean waitOutputStreamCompletion(long timeMilliseconds)
                                      throws ActiveMQException

      Wait the outputStream completion of the message. This method is used when consuming large messages
      Parameters:
        `timeMilliseconds` - - 0 means wait forever
      Returns:
        true if it reached the end
      Throws:
        `ActiveMQException`

    - #### setBodyInputStream

          ClientMessage setBodyInputStream(InputStream bodyInputStream)

      Sets the body's IntputStream.
      This method is used when sending large messages
      Returns:
        this ClientMessage

    - #### putBooleanProperty

          ClientMessage putBooleanProperty(SimpleString key,
                                           boolean value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putBooleanProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putBooleanProperty

          ClientMessage putBooleanProperty(String key,
                                           boolean value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putBooleanProperty` in interface `Message`
      See Also:
        `Message.putBooleanProperty(SimpleString, boolean)`

    - #### putByteProperty

          ClientMessage putByteProperty(SimpleString key,
                                        byte value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putByteProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putByteProperty

          ClientMessage putByteProperty(String key,
                                        byte value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putByteProperty` in interface `Message`
      See Also:
        `Message.putByteProperty(SimpleString, byte)`

    - #### putBytesProperty

          ClientMessage putBytesProperty(SimpleString key,
                                         byte[] value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putBytesProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putBytesProperty

          ClientMessage putBytesProperty(String key,
                                         byte[] value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putBytesProperty` in interface `Message`
      See Also:
        `Message.putBytesProperty(SimpleString, byte[])`

    - #### putShortProperty

          ClientMessage putShortProperty(SimpleString key,
                                         short value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putShortProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putShortProperty

          ClientMessage putShortProperty(String key,
                                         short value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putShortProperty` in interface `Message`
      See Also:
        `Message.putShortProperty(SimpleString, short)`

    - #### putCharProperty

          ClientMessage putCharProperty(SimpleString key,
                                        char value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putCharProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putCharProperty

          ClientMessage putCharProperty(String key,
                                        char value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putCharProperty` in interface `Message`
      See Also:
        `Message.putCharProperty(SimpleString, char)`

    - #### putIntProperty

          ClientMessage putIntProperty(SimpleString key,
                                       int value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putIntProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putIntProperty

          ClientMessage putIntProperty(String key,
                                       int value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putIntProperty` in interface `Message`
      See Also:
        `Message.putIntProperty(SimpleString, int)`

    - #### putLongProperty

          ClientMessage putLongProperty(SimpleString key,
                                        long value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putLongProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putLongProperty

          ClientMessage putLongProperty(String key,
                                        long value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putLongProperty` in interface `Message`
      See Also:
        `Message.putLongProperty(SimpleString, long)`

    - #### putFloatProperty

          ClientMessage putFloatProperty(SimpleString key,
                                         float value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putFloatProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putFloatProperty

          ClientMessage putFloatProperty(String key,
                                         float value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putFloatProperty` in interface `Message`
      See Also:
        `Message.putFloatProperty(SimpleString, float)`

    - #### putDoubleProperty

          ClientMessage putDoubleProperty(SimpleString key,
                                          double value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putDoubleProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putDoubleProperty

          ClientMessage putDoubleProperty(String key,
                                          double value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putDoubleProperty` in interface `Message`
      See Also:
        `Message.putDoubleProperty(SimpleString, double)`

    - #### putStringProperty

          ClientMessage putStringProperty(SimpleString key,
                                          SimpleString value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putStringProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### putStringProperty

          ClientMessage putStringProperty(String key,
                                          String value)

      Overridden from `Message` to enable fluent API
      Specified by:
        `putStringProperty` in interface `Message`
      Parameters:
        `key` - property name
        `value` - property value

    - #### writeBodyBufferBytes

          ClientMessage writeBodyBufferBytes(byte[] bytes)

      Overridden from `Message` to enable fluent API
      Specified by:
        `writeBodyBufferBytes` in interface `Message`

    - #### writeBodyBufferString

          ClientMessage writeBodyBufferString(String string)

      Overridden from `Message` to enable fluent API
      Specified by:
        `writeBodyBufferString` in interface `Message`

Copyright © 2015. All rights reserved.