Class ConsumerEndpoint

java.lang.Object
io.fluxzero.testserver.websocket.WebsocketEndpoint
io.fluxzero.testserver.websocket.ConsumerEndpoint

public class ConsumerEndpoint extends WebsocketEndpoint
  • Constructor Details

    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.MessageType messageType)
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.MessageType messageType, CommandIdempotencyStore commandIdempotencyStore)
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore)
      Creates a consumer endpoint for a topic-specific message log.
      Parameters:
      messageStore - the message store backing the endpoint
      messageType - the message type exposed by this endpoint
      topic - the topic exposed by this endpoint
      commandIdempotencyStore - the idempotency store used for command handling
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageLogMaintenance maintenance, io.fluxzero.common.MessageType messageType, CommandIdempotencyStore commandIdempotencyStore)
      Creates a consumer endpoint backed by shared maintenance components for one message log.
      Parameters:
      maintenance - the shared message log maintenance components
      messageType - the message type exposed by this endpoint
      commandIdempotencyStore - the idempotency store used for command handling
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageLogMaintenance maintenance, io.fluxzero.common.MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore)
      Creates a consumer endpoint backed by shared maintenance components for one message log.
      Parameters:
      maintenance - the shared message log maintenance components
      messageType - the message type exposed by this endpoint
      topic - the topic exposed by this endpoint, or null for non-topic message types
      commandIdempotencyStore - the idempotency store used for command handling
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.MessageLogMaintenance maintenance, io.fluxzero.common.MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore, Consumer<io.fluxzero.common.tracking.WebSocketTracker> readRequestObserver)
      Creates a consumer endpoint that reports each read after it has been registered with the tracking strategy.
      Parameters:
      maintenance - the shared message log maintenance components
      messageType - the message type exposed by the endpoint
      topic - the topic exposed by the endpoint, or null for non-topic message types
      commandIdempotencyStore - the idempotency store used for command handling
      readRequestObserver - observer invoked after a read has been registered with the tracking strategy
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.TrackingStrategy trackingStrategy, io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.tracking.PositionStore positionStore, io.fluxzero.common.MessageType messageType)
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.TrackingStrategy trackingStrategy, io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.tracking.PositionStore positionStore, io.fluxzero.common.MessageType messageType, String topic)
      Creates a consumer endpoint from explicit tracking components.
      Parameters:
      trackingStrategy - the tracking strategy backing reads and claims
      messageStore - the message store backing direct reads
      positionStore - the position store backing consumer positions
      messageType - the message type exposed by this endpoint
      topic - the topic exposed by this endpoint, or null for non-topic message types
    • ConsumerEndpoint

      public ConsumerEndpoint(io.fluxzero.common.tracking.TrackingStrategy trackingStrategy, io.fluxzero.common.tracking.MessageStore messageStore, io.fluxzero.common.tracking.PositionStore positionStore, io.fluxzero.common.MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore)
      Creates a consumer endpoint from explicit tracking components.
      Parameters:
      trackingStrategy - the tracking strategy backing reads and claims
      messageStore - the message store backing direct reads
      positionStore - the position store backing consumer positions
      messageType - the message type exposed by this endpoint
      topic - the topic exposed by this endpoint, or null for non-topic message types
      commandIdempotencyStore - the idempotency store used for command handling
  • Method Details

    • payloadCodecs

      protected List<io.fluxzero.common.api.tracking.TrackingWebSocketCodec> payloadCodecs()
      Description copied from class: WebsocketEndpoint
      Returns compact payload codecs owned by this concrete endpoint protocol.
      Overrides:
      payloadCodecs in class WebsocketEndpoint
    • estimateRequestResultBytes

      protected int estimateRequestResultBytes(io.fluxzero.common.api.RequestResult result)
      Description copied from class: WebsocketEndpoint
      Estimates one endpoint-specific request result for websocket batch sizing.
      Overrides:
      estimateRequestResultBytes in class WebsocketEndpoint
    • onClose

      public void onClose(ServerWebsocketSession session, io.fluxzero.sdk.common.websocket.WebsocketCloseReason closeReason)
      Overrides:
      onClose in class WebsocketEndpoint
    • shutDown

      protected void shutDown()
      Description copied from class: WebsocketEndpoint
      Close all sessions on the websocket after an optional delay. During the delay we don't handle new requests but will be able to send back results.
      Overrides:
      shutDown in class WebsocketEndpoint
    • shouldHandleIdempotently

      protected boolean shouldHandleIdempotently(io.fluxzero.common.api.Command command)
      Overrides:
      shouldHandleIdempotently in class WebsocketEndpoint
    • toString

      public String toString()
      Overrides:
      toString in class Object