Definition
Specifying TCP in your protocol stack tells JGroups to use TCP to send messages between group members. Instead of using a multicast bus, the group members create a mesh of TCP connections.
Configuration Example
<TCP bind_addr="192.168.1.3" start_port="7800" ></TCP>
Configuration Parameters
| Name | Description |
|---|---|
| bind_addr | The bind address which should be used by this transport |
| bind_interface_str | The interface (NIC) which should be used by this transport |
| bind_port | The port to which the transport binds. Default of 0 binds to any (ephemeral) port |
| bundler_capacity | The max number of elements in a bundler if the bundler supports size limitations |
| bundler_type | The type of bundler used. Has to be "old" (default) or "new" |
| conn_expire_time | Max time connection can be idle before being reaped (in ms) |
| diagnostics_addr | Address for diagnostic probing. Default is 224.0.75.75 |
| diagnostics_port | Port for diagnostic probing. Default is 7500 |
| discard_incompatible_packets | Discard packets with a different version if true. Default is false |
| enable_bundling | Enable bundling of smaller messages into bigger ones. Default is true |
| enable_diagnostics | Switch to enable diagnostic probing. Default is true |
| enable_unicast_bundling | Enable bundling of smaller messages into bigger ones for unicast messages. Default is false |
| external_addr | Use "external_addr" if you have hosts on different networks, behind firewalls. On each firewall, set up a port forwarding rule (sometimes called "virtual server") to the local IP (e.g. 192.168.1.100) of the host then on each host, set "external_addr" TCP transport parameter to the external (public IP) address of the firewall. |
| id | Give the protocol a different ID if needed so we can have multiple instances of it in the same stack |
| level | Sets the logger level (see javadocs) |
| linger | SO_LINGER in msec. Default of -1 disables it |
| log_discard_msgs | whether or not warnings about messages from different groups are logged |
| logical_addr_cache_expiration | Time (in ms) after which entries in the logical address cache marked as removable are removed |
| logical_addr_cache_max_size | Max number of elements in the logical address cache before eviction starts |
| loopback | Messages to self are looped back immediately if true |
| marshaller_pool_size | |
| max_bundle_size | Maximum number of bytes for messages to be queued until they are sent |
| max_bundle_timeout | Max number of milliseconds until queued messages are sent |
| name | Give the protocol a different name if needed so we can have multiple instances of it in the same stack |
| num_timer_threads | Number of threads to be used by the timer thread pool. Default is 4 |
| oob_thread_pool.keep_alive_time | Timeout in ms to remove idle threads from the OOB pool |
| oob_thread_pool.max_threads | Max thread pool size for the OOB thread pool |
| oob_thread_pool.min_threads | Minimum thread pool size for the OOB thread pool |
| oob_thread_pool_enabled | Switch for enabling thread pool for OOB messages. Default=true |
| oob_thread_pool_queue_enabled | Use queue to enqueue incoming OOB messages |
| oob_thread_pool_queue_max_size | Maximum queue size for incoming OOB messages. Default is 500 |
| oob_thread_pool_rejection_policy | Thread rejection policy. Possible values are Abort, Discard, DiscardOldest and Run. Default is Discard |
| peer_addr_read_timeout | Max time to block on reading of peer address |
| port_range | The range of valid ports, from bind_port to end_port. Infinite if 0 |
| reaper_interval | Reaper interval in msec. Default is 0 (no reaping) |
| receive_interfaces | Comma delimited list of interfaces (IP addresses or interface names) to receive multicasts on |
| receive_on_all_interfaces | If true, the transport should use all available interfaces to receive multicast messages |
| recv_buf_size | Receiver buffer size in bytes |
| send_buf_size | Send buffer size in bytes |
| send_queue_size | Max number of messages in a send queue |
| singleton_name | If assigned enable this transport to be a singleton (shared) transport |
| sock_conn_timeout | Max time allowed for a socket creation in ConnectionTable |
| stats | Determines whether to collect statistics (and expose them via JMX). Default is true |
| tcp_nodelay | Should TCP no delay flag be turned on |
| thread_naming_pattern | Thread naming pattern for threads in this channel. Default is cl |
| thread_pool.keep_alive_time | Timeout in milliseconds to remove idle thread from regular pool |
| thread_pool.max_threads | Maximum thread pool size for the regular thread pool |
| thread_pool.min_threads | Minimum thread pool size for the regular thread pool |
| thread_pool_enabled | Switch for enabling thread pool for regular messages. Default true |
| thread_pool_queue_enabled | Use queue to enqueue incoming regular messages. Default is true |
| thread_pool_queue_max_size | Maximum queue size for incoming OOB messages. Default is 500 |
| thread_pool_rejection_policy | Thread rejection policy. Possible values are Abort, Discard, DiscardOldest and Run. Default is Discard |
| use_local_host | Ignores all bind address parameters and let's the OS return the local host address |
| use_send_queues | Should separate send queues be used for each connection |
See also Protocol Configuration Common Parameters
Advanced
Each time two TCP members connect, the member that intiates the connection sends a cookie (4 bytes), the JGroups version and its own . This data is read on the 's AcceptorThread of the accepting member, and if the cookie matches, a new corresponding Connection is created and added to the
If the TCP layer is required to send a unicast message to a member for which it doesn't have a Connection (open socket) in its ConnectionTable, it first tries to create a socket and the associated Connection and register it in the ConnectionTable.

Comments