Interface Outbox

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Outbox consume​(Consumer<Message> messageConsumer)
      Start consuming messages from the Outbox using the provided message consumer.
      Only needs to be called if the instance was created without a message consumer
      long getNumberOfOutgoingMessages()
      Get the number of message in the outbox that haven't been sent yet
      boolean hasAMessageConsumer()
      Has the instance been created with a Message consumer or has consume(Consumer) been called
      boolean isConsumingMessages()
      Is the provided Message consumer consuming messages from the Outbox
      OutboxName name()
      The name of the outbox
      void sendMessage​(Message message)
      Send a message asynchronously.
      This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
      The message will be delivered asynchronously to the message consumer
      default void sendMessage​(Object payload)
      Send a message (without meta-data) asynchronously.
      This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
      The message will be delivered asynchronously to the message consumer
      default void sendMessage​(Object payload, MessageMetaData metaData)
      Send a message (with meta-data) asynchronously.
      This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
      The message will be delivered asynchronously to the message consumer
      void stopConsuming()
      Stop consuming messages from the Outbox.
    • Method Detail

      • stopConsuming

        void stopConsuming()
        Stop consuming messages from the Outbox. Calling this method will remove the message consumer and to resume message consumption you need to call consume(Consumer)
      • hasAMessageConsumer

        boolean hasAMessageConsumer()
        Has the instance been created with a Message consumer or has consume(Consumer) been called
        Returns:
        Has the instance been created with a Message consumer or has consume(Consumer) been called
      • isConsumingMessages

        boolean isConsumingMessages()
        Is the provided Message consumer consuming messages from the Outbox
        Returns:
        Is the provided Message consumer consuming messages from the Outbox
      • name

        OutboxName name()
        The name of the outbox
        Returns:
        the name of the outbox
      • sendMessage

        default void sendMessage​(Object payload)
        Send a message (without meta-data) asynchronously.
        This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
        The message will be delivered asynchronously to the message consumer
        Parameters:
        payload - the message payload
      • sendMessage

        default void sendMessage​(Object payload,
                                 MessageMetaData metaData)
        Send a message (with meta-data) asynchronously.
        This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
        The message will be delivered asynchronously to the message consumer
        Parameters:
        payload - the message payload
        metaData - the message meta-data
      • sendMessage

        void sendMessage​(Message message)
        Send a message asynchronously.
        This message will be stored durably (without any duplication check) in connection with the currently active UnitOfWork (or a new UnitOfWork will be created in case no there isn't an active UnitOfWork).
        The message will be delivered asynchronously to the message consumer
        Parameters:
        message - the message
        See Also:
        OrderedMessage
      • getNumberOfOutgoingMessages

        long getNumberOfOutgoingMessages()
        Get the number of message in the outbox that haven't been sent yet
        Returns:
        Get the number of message in the outbox that haven't been sent yet