Class ConsumerEndpoint
java.lang.Object
io.fluxzero.testserver.websocket.WebsocketEndpoint
io.fluxzero.testserver.websocket.ConsumerEndpoint
-
Nested Class Summary
Nested classes/interfaces inherited from class WebsocketEndpoint
WebsocketEndpoint.ClientMessage, WebsocketEndpoint.PingRegistration, WebsocketEndpoint.SessionBacklog -
Field Summary
Fields inherited from class WebsocketEndpoint
pingDelay, pingTimeout, shutDown, shuttingDown, webSocketSendTimeout -
Constructor Summary
ConstructorsConstructorDescriptionConsumerEndpoint(MessageLogMaintenance maintenance, MessageType messageType, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint backed by shared maintenance components for one message log.ConsumerEndpoint(MessageLogMaintenance maintenance, MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint backed by shared maintenance components for one message log.ConsumerEndpoint(MessageStore messageStore, MessageType messageType) ConsumerEndpoint(MessageStore messageStore, MessageType messageType, CommandIdempotencyStore commandIdempotencyStore) ConsumerEndpoint(MessageStore messageStore, MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint for a topic-specific message log.ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType) ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType, String topic) Creates a consumer endpoint from explicit tracking components.ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint from explicit tracking components. -
Method Summary
Modifier and TypeMethodDescriptionvoidonClose(ServerWebsocketSession session, WebsocketCloseReason closeReason) protected booleanshouldHandleIdempotently(Command command) protected voidshutDown()Close all sessions on the websocket after an optional delay.toString()Methods inherited from class WebsocketEndpoint
abort, createTasks, createTasks, deserializeRequest, dispatchRequest, dispatchRequest, doSendResult, findAlternativeBacklog, getClientId, getClientName, getClientSdkVersion, getCompressionAlgorithm, getNamespace, getNegotiatedSessionId, getRequestHeaders, getRuntimeVersion, getTransportFormat, handleMessage, handleMessage, newRequestStripeExecutors, onError, onMessage, onOpen, onPong, registerMetrics, schedulePing, sendPing, sendResultBatch, sendResultBatchAsync, sessionMetadata, submitRequestTask, transportCodec
-
Constructor Details
-
ConsumerEndpoint
-
ConsumerEndpoint
public ConsumerEndpoint(MessageStore messageStore, MessageType messageType, CommandIdempotencyStore commandIdempotencyStore) -
ConsumerEndpoint
public ConsumerEndpoint(MessageStore messageStore, MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint for a topic-specific message log.- Parameters:
messageStore- the message store backing the endpointmessageType- the message type exposed by this endpointtopic- the topic exposed by this endpointcommandIdempotencyStore- the idempotency store used for command handling
-
ConsumerEndpoint
public ConsumerEndpoint(MessageLogMaintenance maintenance, MessageType messageType, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint backed by shared maintenance components for one message log.- Parameters:
maintenance- the shared message log maintenance componentsmessageType- the message type exposed by this endpointcommandIdempotencyStore- the idempotency store used for command handling
-
ConsumerEndpoint
public ConsumerEndpoint(MessageLogMaintenance maintenance, 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 componentsmessageType- the message type exposed by this endpointtopic- the topic exposed by this endpoint, ornullfor non-topic message typescommandIdempotencyStore- the idempotency store used for command handling
-
ConsumerEndpoint
public ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType) -
ConsumerEndpoint
public ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType, String topic) Creates a consumer endpoint from explicit tracking components.- Parameters:
trackingStrategy- the tracking strategy backing reads and claimsmessageStore- the message store backing direct readspositionStore- the position store backing consumer positionsmessageType- the message type exposed by this endpointtopic- the topic exposed by this endpoint, ornullfor non-topic message types
-
ConsumerEndpoint
public ConsumerEndpoint(TrackingStrategy trackingStrategy, MessageStore messageStore, PositionStore positionStore, MessageType messageType, String topic, CommandIdempotencyStore commandIdempotencyStore) Creates a consumer endpoint from explicit tracking components.- Parameters:
trackingStrategy- the tracking strategy backing reads and claimsmessageStore- the message store backing direct readspositionStore- the position store backing consumer positionsmessageType- the message type exposed by this endpointtopic- the topic exposed by this endpoint, ornullfor non-topic message typescommandIdempotencyStore- the idempotency store used for command handling
-
-
Method Details
-
onClose
- Overrides:
onClosein classWebsocketEndpoint
-
shutDown
protected void shutDown()Description copied from class:WebsocketEndpointClose 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:
shutDownin classWebsocketEndpoint
-
shouldHandleIdempotently
- Overrides:
shouldHandleIdempotentlyin classWebsocketEndpoint
-
toString
-