Same as Tranquilizer.send.
Same as Tranquilizer.send.
the message to send
a future that resolves when the message is sent
Stop the tranquilizer, and close the underlying Beam.
Stop the tranquilizer, and close the underlying Beam.
Block until all messages that have been passed to "send" before this call to "flush" have been processed and their futures have been resolved.
Block until all messages that have been passed to "send" before this call to "flush" have been processed and their futures have been resolved.
This method will not throw any exceptions, even if some messages failed to send. You need to check the returned futures for that.
Sends a message.
Sends a message. Generally asynchronous, but will block to provide backpressure if the internal buffer is full.
The future may contain a Unit, in which case the message was successfully sent. Or it may contain an exception, in which case the message may or may not have been successfully sent. One specific exception to look out for is MessageDroppedException, which means that a message was dropped due to unrecoverable reasons. With Druid this can be caused by message timestamps being outside the configured windowPeriod.
message to send
future that resolves when the message is sent, or fails to send
if outgoing queue is full and blockOnFull is false.
Create a SimpleTranquilizerAdapter based on this Tranquilizer.
Create a SimpleTranquilizerAdapter based on this Tranquilizer. You can create multiple adapters based on the same Tranquilizer, and even use them simultaneously.
true if the adapter should report message drops as exceptions. Otherwise, drops are ignored (but will still be reflected in the counters).
a simple adapter
Start the tranquilizer.
Start the tranquilizer. Must be called before any calls to "send" or "apply".
Stop the tranquilizer, and close the underlying Beam.
Stop the tranquilizer, and close the underlying Beam. Blocks until closed. Generally you should either use this method or Tranquilizer.close, but not both.
Tranquilizers allow you to provide single messages and get a future for each message reporting success or failure. Tranquilizers provide batching and backpressure, unlike Beams which require you to batch messages on your own and do not provide backpressure.
The expected use case of this class is to send individual messages efficiently, possibly from multiple threads, and receive success or failure information for each message. This class is thread-safe.
To create Tranquilizers, use Tranquilizer$.create, Tranquilizer$.builder, or com.metamx.tranquility.druid.DruidBeams$$Builder#buildTranquilizer.