The channel sender component is responsible for delivering outgoing cluster messages over the network.
In the default implementation,
the sender is a fairly empty shell with not much logic around a fairly complex
component the implements the actual delivery mechanism.
In the default
Apache Tribes implements what we like to call "Concurrent Parallel Delivery".
This means that we can send a message to more than one destination at the same time(parallel), and
deliver two messages to the same destination at the same time(concurrent). Combine these two and we have
"Concurrent Parallel Delivery".
When is this useful? The simplest example we can think of is when part of your code is sending a 10MB message, like a war file being deployed, and you need to push through a small 10KB message, say a session being replicated, you don't have to wait for the 10MB message to finish, as a separate thread will push in the small message transmission at the same time. Currently there is no interrupt, pause or priority mechanism available, but check back soon.
The nested element
<Transport> is not required, but encouraged, as this is where
you would set all the socket options for the outgoing messages. Please see its attributes below.
There are two implementations, in a similar manner to the receiver, one is non-blocking
based and the other is built using blocking IO.
org.apache.catalina.tribes.transport.bio.PooledMultiSender is the blocking implementation and
Parallel delivery is not available for the blocking implementation due to the fact that it is blocking a thread on sending data.
false. Set to true if you want the receiver to use direct bytebuffers when writing data to the sockets. Default value is
-1, which is unlimited.
-1, which is unlimited.
3000milliseconds.(3 seconds) This timeout starts when a message send attempt is starting, until the transfer has been completed. For the NIO sockets, this will mean, that the caller can guarantee that we will not attempt sending the message longer than this timeout value. For the blocking IO implementation, this translated directly to the soTimeout.
1, meaning we will retry a message that has failed once. In other words, we will attempt a message send no more than twice. One is the original send, and one is the
false. Default value is
int soTrafficClass = 0x04 | 0x08 | 0x010;Different values are defined in java.net.Socket#setTrafficClass(int).
false. The default value is
true. If set to true, the sender will throw a
org.apache.catalina.tribes.RemoteProcessExceptionwhen we receive a negative ack from the remote member. Set to false, and Tribes will treat a positive ack the same way as a negative ack, that the message was received.