Interface Inbox

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void addMessageReceived​(Message message)
      Register or add a message that has been received
      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 addMessageReceived​(Object payload)
      Register or add a message (without meta-data) that has been received
      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 addMessageReceived​(Object payload, MessageMetaData metaData)
      Register or add a message (with meta-data) that has been received
      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
      Inbox 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 getNumberOfUndeliveredMessages()
      Get the number of message received that haven't been processed yet (or successfully processed) by the message consumer
      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
      InboxName name()
      The name of the inbox
      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

        InboxName name()
        The name of the inbox
        Returns:
        the name of the inbox
      • addMessageReceived

        default void addMessageReceived​(Object payload,
                                        MessageMetaData metaData)
        Register or add a message (with meta-data) that has been received
        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
      • addMessageReceived

        default void addMessageReceived​(Object payload)
        Register or add a message (without meta-data) that has been received
        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
      • addMessageReceived

        void addMessageReceived​(Message message)
        Register or add a message that has been received
        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
      • getNumberOfUndeliveredMessages

        long getNumberOfUndeliveredMessages()
        Get the number of message received that haven't been processed yet (or successfully processed) by the message consumer
        Returns:
        the number of message received that haven't been processed yet (or successfully processed) by the message consumer