Interface MessageSubscription


public interface MessageSubscription

Messages will be delivered even if the Messages Query HTTP API is not enabled.

For MessageSubscriptions, the format of the payload is MessageDeliveryPayload.


Example to create an instance using the builder pattern

     MessageSubscription messageSubscription = MessageSubscription.builder()
             .resourceTypeId(MessageSubscriptionResourceTypeId.APPROVAL_FLOW)
             .build()
 
  • Method Details

    • getResourceTypeId

      @NotNull @NotNull MessageSubscriptionResourceTypeId getResourceTypeId()

      Unique identifier for the type of resource, for example, order.

      Returns:
      resourceTypeId
    • getTypes

      List<String> getTypes()

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Returns:
      types
    • setResourceTypeId

      void setResourceTypeId(MessageSubscriptionResourceTypeId resourceTypeId)

      Unique identifier for the type of resource, for example, order.

      Parameters:
      resourceTypeId - value to be set
    • setTypes

      void setTypes(String... types)

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Parameters:
      types - values to be set
    • setTypes

      void setTypes(List<String> types)

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Parameters:
      types - values to be set
    • of

      static MessageSubscription of()
      factory method
      Returns:
      instance of MessageSubscription
    • of

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

      factory method to create a deep copy of MessageSubscription
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static MessageSubscriptionBuilder builder()
      builder factory method for MessageSubscription
      Returns:
      builder
    • builder

      create builder for MessageSubscription instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMessageSubscription

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

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