View Javadoc

1   package com.atlassian.messagequeue;
2   
3   import com.atlassian.annotations.PublicApi;
4   
5   /**
6    * Thrown when invalid characters are detected in the payload of a {@link Message}.
7    *
8    * Valid characters are defined here: https://www.w3.org/TR/REC-xml/#charsets
9    *
10   * @since 1.0
11   */
12  @PublicApi
13  public class InvalidMessagePayloadException extends MessageRunnerServiceException {
14      /**
15       * Constructs a new instance of invalid message payload exception.
16       * @param messageRunnerKey the message runner key
17       * @param invalidCodePoint the invalid unicode code point
18       */
19      public InvalidMessagePayloadException(MessageRunnerKey messageRunnerKey, int invalidCodePoint) {
20          super(String.format("Payload with invalid code point U+%06X found in message (messageRunnerKey: %s). " +
21                  "Ensure all characters in the payload correspond to valid code points as defined by https://www.w3.org/TR/REC-xml/#charsets.", invalidCodePoint, messageRunnerKey));
22      }
23  }