Interface DetachedDurableMessageSender


public interface DetachedDurableMessageSender
Utility for sending a durable message without requiring an explicit NotificationStateAware entity in which to deposit the durable tracking NotificationState instance for the message send.
  • Method Details

    • send

      void send(Object payload, String messageType, String id, @Nullable String routeKey)
      Send a durable message.
      Parameters:
      payload - The object representing the message payload. Will be converted to JSON over the wire.
      messageType - A unique identifying name for this message type.
      id - A unique id for this message. Note, the approach for generating this id should be idempotent. For example, if for some reason the same message is passed through this send method twice, the id should remain the same for those two calls. Note, this id will also be passed in the message header as DefaultMessageLockService.MESSAGE_IDEMPOTENCY_KEY.
      routeKey - Optional. The key of the data route on which the durable operation should be performed. This relates to the JpaDataRoute.routeKey() parameter for setting up a specific datasource to a backing datastore. If left null, it is assumed that data routing is either not being used, or has already been initialized earlier in the call stack with a route establishing annotation, such as DataRouteByKey or DataRouteByExample.
      Throws:
      IllegalStateException - If data routing is enabled and there is no route key defined here or via route establishing annotation.
    • send

      void send(Object payload, String messageType, String id, @Nullable String routeKey, Map<String,String> additionalHeaders)
      Send a durable message.
      Parameters:
      payload - The object representing the message payload. Will be converted to JSON over the wire.
      messageType - A unique identifying name for this message type.
      id - A unique id for this message. Note, the approach for generating this id should be idempotent. For example, if for some reason the same message is passed through this send method twice, the id should remain the same for those two calls. Note, this id will also be passed in the message header as DefaultMessageLockService.MESSAGE_IDEMPOTENCY_KEY.
      routeKey - Optional. The key of the data route on which the durable operation should be performed. This relates to the JpaDataRoute.routeKey() parameter for setting up a specific datasource to a backing datastore. If left null, it is assumed that data routing is either not being used, or has already been initialized earlier in the call stack with a route establishing annotation, such as DataRouteByKey or DataRouteByExample.
      additionalHeaders - A map of any additional headers to place on the message
      Throws:
      IllegalStateException - If data routing is enabled and there is no route key defined here or via route establishing annotation.