Class InvalidPayloadException

All Implemented Interfaces:
Serializable

public class InvalidPayloadException extends BabelQueueException
Raised when a message's data does not match the JSON Schema registered for its URN (ADR-0024). The consumer-side SchemaValidation.wrap(com.babelqueue.schema.SchemaProvider, com.babelqueue.idempotency.Handler) throws it so the adapter redelivers (and eventually dead-letters) a poison message; the recommended primary use is producer-side (SchemaValidation.validate(com.babelqueue.schema.SchemaProvider, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)) so invalid data never enters the queue.
See Also:
  • Constructor Details

    • InvalidPayloadException

      public InvalidPayloadException(String urn, String violation)
      Parameters:
      urn - the message URN whose schema was violated
      violation - the first "<json-pointer>: <reason>" mismatch
  • Method Details

    • urn

      public String urn()
      Returns:
      the message URN whose schema was violated
    • violation

      public String violation()
      Returns:
      the first "<json-pointer>: <reason>" mismatch