Class AMQPLargeMessageWriter

  • All Implemented Interfaces:
    Consumer<org.apache.activemq.artemis.core.server.MessageReference>, MessageWriter

    public class AMQPLargeMessageWriter
    extends Object
    implements MessageWriter
    A writer of AMQPLargeMessage content that handles the read from large message file and write into the AMQP sender with some respect for the AMQP frame size in use by this connection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Mark the writer as done and release any resources that it might be holding, this call should trigger the busy method to return false for any handler that has a busy state.
      boolean isWriting()
      This should return true when a delivery is still in progress as a hint to the sender that new messages can't be accepted yet.
      AMQPLargeMessageWriter open​(org.apache.activemq.artemis.core.server.MessageReference reference)
      Opens the handler and ensures the handler state is in its initial values to prepare for a new message write.
      void writeBytes​(org.apache.activemq.artemis.core.server.MessageReference messageReference)
      Begin delivery of a message providing the original message reference instance.
      • Methods inherited from interface org.apache.activemq.artemis.protocol.amqp.proton.MessageWriter

        accept
    • Method Detail

      • isWriting

        public boolean isWriting()
        Description copied from interface: MessageWriter
        This should return true when a delivery is still in progress as a hint to the sender that new messages can't be accepted yet. The handler can be paused during delivery of large payload data due to IO or session back pressure. The context is responsible for scheduling itself for resumption when it finds that it must halt delivery work.

        This could be called from outside the connection thread so the state should be thread safe however the sender should take care to restart deliveries in a safe way taking into account that this value might not get seen by other threads in its non-busy state when the delivery completes.

        Specified by:
        isWriting in interface MessageWriter
        Returns:
        true if the handler is still working on delivering a message.
      • close

        public void close()
        Description copied from interface: MessageWriter
        Mark the writer as done and release any resources that it might be holding, this call should trigger the busy method to return false for any handler that has a busy state. It is expected that the sender will close each handler after it reports that writing the message has completed. This must be called from the connection thread.
        Specified by:
        close in interface MessageWriter
      • open

        public AMQPLargeMessageWriter open​(org.apache.activemq.artemis.core.server.MessageReference reference)
        Description copied from interface: MessageWriter
        Opens the handler and ensures the handler state is in its initial values to prepare for a new message write. This is only applicable to handlers that have state data but should be called on every handler by the sender context as it doesn't know which instances need opened.
        Specified by:
        open in interface MessageWriter
      • writeBytes

        public void writeBytes​(org.apache.activemq.artemis.core.server.MessageReference messageReference)
        Description copied from interface: MessageWriter
        Begin delivery of a message providing the original message reference instance. The writer should be linked to a parent sender or sender controller which it will use for obtaining services needed to send and complete sending operations. This must be called from the connection thread.

        Once delivery processing completes (successful or not) the handler must inform the server sender of the outcome so that further deliveries can be sent or error processing can commence.

        Specified by:
        writeBytes in interface MessageWriter
        Parameters:
        messageReference - The original message reference that triggered the delivery.