-
Notifications
You must be signed in to change notification settings - Fork 170
Suro Client
There are two types of Suro clients, synchronous and asynchronous one. Synchronous one is useful to send the message one by one to ensure the message is delivered to Suro server side. Also, it exposes the method sending message set. While asynchronous client has a internal message queue, synchronous client is blocked before receiving ACK from Suro server
Alike other client implementation, Suro client is connection pooling. The major difference is, it tries to keep only one connection to one Suro server instance as possible. Since connection pool is the singleton object, if the number of senders is greater than the number of Suro servers, extra connections will be created and managed out of pooling because Thrift client is not thread-safe. To reduce synchronization overhead, the retention period of connection can be specified, for example, suro client does not switch the connection within 5 minutes with some configuration.
User can choose from the memory queue and file backed queue. Memory queue is more efficient than file backed queue in the throughput perspective by 25% but when the senders cannot follow up the incoming message traffic, bounded memory queue will drop messages. Meanwhile, file backed queue is not bounded with the ample disk space, almost 0% message loss can be expected. The file backed queue implementation is bigqueue.