Class MessageRelayResource<MessageType>

java.lang.Object
org.apache.druid.messages.server.MessageRelayResource<MessageType>

public class MessageRelayResource<MessageType> extends Object
Server-side resource for message relaying. Wraps an Outbox and MessageListener. The client for this resource is MessageRelayClient.
  • Constructor Details

    • MessageRelayResource

      public MessageRelayResource(Outbox<MessageType> outbox, com.fasterxml.jackson.databind.ObjectMapper smileMapper, Class<MessageType> messageClass)
  • Method Details

    • httpGetMessagesFromOutbox

      public Void httpGetMessagesFromOutbox(String clientHost, Long epoch, Long watermark, @Context javax.servlet.http.HttpServletRequest req) throws IOException
      Retrieve messages from the outbox for a particular client, as a MessageBatch in Smile format. The messages are retrieved from Outbox.getMessages(String, long, long). This is a long-polling async method, using AsyncContext to wait up to GET_MESSAGES_TIMEOUT for messages to appear in the outbox.
      Returns:
      HTTP 200 with Smile response with messages on success; HTTP 204 (No Content) if no messages were put in the outbox before the timeout GET_MESSAGES_TIMEOUT elapsed
      Throws:
      IOException
      See Also: