Interface MessageDeliveryPayload

All Superinterfaces:
DeliveryPayload, MessageDeliveryPayloadMixin, SubscriptionNotification
All Known Subinterfaces:
MessageDelivery

public interface MessageDeliveryPayload extends DeliveryPayload, MessageDeliveryPayloadMixin

This payload is sent for a MessageSubscription.


Example to create an instance using the builder pattern

     MessageDeliveryPayload messageDeliveryPayload = MessageDeliveryPayload.builder()
             .projectKey("{projectKey}")
             .resource(resourceBuilder -> resourceBuilder)
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .sequenceNumber(0.3)
             .resourceVersion(0.3)
             .build()
 
  • Field Details

  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique ID of the message.

      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Last seen version of the resource.

      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the resource was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the resource was last modified.

      Returns:
      lastModifiedAt
    • getSequenceNumber

      @NotNull @NotNull Long getSequenceNumber()

      Used to ensure all messages of the resource are processed in correct order. The sequenceNumber of the next message of the resource is a successor of the sequenceNumber of the current message.

      Returns:
      sequenceNumber
    • getResourceVersion

      @NotNull @NotNull Long getResourceVersion()

      Version of the resource on which the update was performed.

      Returns:
      resourceVersion
    • getPayloadNotIncluded

      @Valid @Valid PayloadNotIncluded getPayloadNotIncluded()

      Present when the payload exceeds the size limit of the message queue (the limit is often 256 KB) or its format is not accepted by the messaging service. If the payload exceeds the size limit, the additional Message fields are replaced with a PayloadNotIncluded object. You can retrieve the full Message using the Messages API if the feature is enabled.

      Returns:
      payloadNotIncluded
    • setId

      void setId(String id)

      Unique ID of the message.

      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Last seen version of the resource.

      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the resource was initially created.

      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the resource was last modified.

      Parameters:
      lastModifiedAt - value to be set
    • setSequenceNumber

      void setSequenceNumber(Long sequenceNumber)

      Used to ensure all messages of the resource are processed in correct order. The sequenceNumber of the next message of the resource is a successor of the sequenceNumber of the current message.

      Parameters:
      sequenceNumber - value to be set
    • setResourceVersion

      void setResourceVersion(Long resourceVersion)

      Version of the resource on which the update was performed.

      Parameters:
      resourceVersion - value to be set
    • setPayloadNotIncluded

      void setPayloadNotIncluded(PayloadNotIncluded payloadNotIncluded)

      Present when the payload exceeds the size limit of the message queue (the limit is often 256 KB) or its format is not accepted by the messaging service. If the payload exceeds the size limit, the additional Message fields are replaced with a PayloadNotIncluded object. You can retrieve the full Message using the Messages API if the feature is enabled.

      Parameters:
      payloadNotIncluded - value to be set
    • of

      factory method
      Returns:
      instance of MessageDeliveryPayload
    • of

      factory method to create a shallow copy MessageDeliveryPayload
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface DeliveryPayload
      Specified by:
      copyDeep in interface SubscriptionNotification
    • deepCopy

      @Nullable static MessageDeliveryPayload deepCopy(@Nullable MessageDeliveryPayload template)
      factory method to create a deep copy of MessageDeliveryPayload
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for MessageDeliveryPayload
      Returns:
      builder
    • builder

      create builder for MessageDeliveryPayload instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMessageDeliveryPayload

      default <T> T withMessageDeliveryPayload(Function<MessageDeliveryPayload,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static tools.jackson.core.type.TypeReference<MessageDeliveryPayload> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference