Class WebSocketFirehoseProducerWorker<T>

java.lang.Object
io.aleph0.yap.messaging.jetty.worker.WebSocketFirehoseProducerWorker<T>
All Implemented Interfaces:
io.aleph0.yap.core.Measureable<FirehoseMetrics>, io.aleph0.yap.core.ProducerWorker<Message<T>>, io.aleph0.yap.core.worker.MeasuredProducerWorker<Message<T>,FirehoseMetrics>, FirehoseProducerWorker<Message<T>>

public class WebSocketFirehoseProducerWorker<T> extends Object implements FirehoseProducerWorker<Message<T>>
A FirehoseProducerWorker that connects to a WebSocket server and sends messages to a Sink.

The given WebSocketFirehoseProducerWorker.MessageFactory is used to create messages from the text and binary frames received from the WebSocket server. The WebSocketFirehoseProducerWorker.Configurator is used to configure the WebSocket client and the HTTP client used to connect to the server.

Because the MessageFactory is responsible for creating messages, it is also responsible for defining the ack and nack semantics. Users should take care to ensure that the implemented semantics match the required semantics, particularly idempotence and mutually exclusive acks and nacks.

On sink failure, the worker will close the socket gracefully and fail.

On socket error, the worker will simply close the socket and fail.

On interrupt, the worker will attempt to close the connection gracefully. If this takes too long, then it will simply close the socket. The worker will then propagate the interrupt.