com.metamx.tranquility.tranquilizer
The number of messages that have failed to send, including drops.
The number of messages that have failed to send, including drops. This includes drops even if you have disabled
reportDropsAsExceptions
.
failed count
Wait for all pending messages to flush out, and throw an exception if there was one.
Wait for all pending messages to flush out, and throw an exception if there was one. Blocks until all pending messages are flushed.
The number of messages that you've sent to this object so far.
The number of messages that you've sent to this object so far.
received count
Send a message.
Send a message. The actual send may happen asynchronously. If you must know whether or not there was an exception sending it, call "flush", which will flush all pending messages and throw an exception if there was one.
This method may throw an exception if there was one, although it is not guaranteed. Furthermore, if this method does throw an exception, it might be for a different message.
The number of messages that have successfully been sent through the underlying Tranquilizer.
The number of messages that have successfully been sent through the underlying Tranquilizer.
sent count
Wrap a Tranquilizer, exposing an API that is meant to be easy to use for a single caller that doesn't care exactly what happens with individual messages, but does care about having exceptions and counts reported eventually.
Exceptions are reported from time to time when you call "send", and always when you call "flush". Only one exception will be reported at a time. Note that exceptions triggered by "send" may not necessarily be related to the actual message you passed; they could be from a previous message.
The expected use case of the simple adapter is that if you get an exception from "send" or "flush", you should stop using the adapter and create a new one. It is not meant to make it possible to associate specific exceptions with specific messages.
Calling "start" or "stop" on this adapter will start or stop the underlying Tranquilizer. If you want to start or stop the underlying Tranquilizer yourself, then do not call "start" or "stop" on this adapter.
The expected use case of this class is that it is used by a single thread.