Version 30

    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

    NameDescription
    bind_addrThe bind address which should be used by this transport
    bind_interface_strThe interface (NIC) which should be used by this transport
    bind_portThe port to which the transport binds. Default of 0 binds to any (ephemeral) port
    bundler_capacityThe max number of elements in a bundler if the bundler supports size limitations
    bundler_typeThe type of bundler used. Has to be "old" (default) or "new"
    conn_expire_timeMax time connection can be idle before being reaped (in ms)
    diagnostics_addrAddress for diagnostic probing. Default is 224.0.75.75
    diagnostics_portPort for diagnostic probing. Default is 7500
    discard_incompatible_packetsDiscard packets with a different version if true. Default is false
    enable_bundlingEnable bundling of smaller messages into bigger ones. Default is true
    enable_diagnosticsSwitch to enable diagnostic probing. Default is true
    enable_unicast_bundlingEnable bundling of smaller messages into bigger ones for unicast messages. Default is false
    external_addrUse "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.
    idGive the protocol a different ID if needed so we can have multiple instances of it in the same stack
    levelSets the logger level (see javadocs)
    lingerSO_LINGER in msec. Default of -1 disables it
    log_discard_msgswhether or not warnings about messages from different groups are logged
    logical_addr_cache_expirationTime (in ms) after which entries in the logical address cache marked as removable are removed
    logical_addr_cache_max_sizeMax number of elements in the logical address cache before eviction starts
    loopbackMessages to self are looped back immediately if true
    marshaller_pool_size
    max_bundle_sizeMaximum number of bytes for messages to be queued until they are sent
    max_bundle_timeoutMax number of milliseconds until queued messages are sent
    nameGive the protocol a different name if needed so we can have multiple instances of it in the same stack
    num_timer_threadsNumber of threads to be used by the timer thread pool. Default is 4
    oob_thread_pool.keep_alive_timeTimeout in ms to remove idle threads from the OOB pool
    oob_thread_pool.max_threadsMax thread pool size for the OOB thread pool
    oob_thread_pool.min_threadsMinimum thread pool size for the OOB thread pool
    oob_thread_pool_enabledSwitch for enabling thread pool for OOB messages. Default=true
    oob_thread_pool_queue_enabledUse queue to enqueue incoming OOB messages
    oob_thread_pool_queue_max_sizeMaximum queue size for incoming OOB messages. Default is 500
    oob_thread_pool_rejection_policyThread rejection policy. Possible values are Abort, Discard, DiscardOldest and Run. Default is Discard
    peer_addr_read_timeoutMax time to block on reading of peer address
    port_rangeThe range of valid ports, from bind_port to end_port. Infinite if 0
    reaper_intervalReaper interval in msec. Default is 0 (no reaping)
    receive_interfacesComma delimited list of interfaces (IP addresses or interface names) to receive multicasts on
    receive_on_all_interfacesIf true, the transport should use all available interfaces to receive multicast messages
    recv_buf_sizeReceiver buffer size in bytes
    send_buf_sizeSend buffer size in bytes
    send_queue_sizeMax number of messages in a send queue
    singleton_nameIf assigned enable this transport to be a singleton (shared) transport
    sock_conn_timeoutMax time allowed for a socket creation in ConnectionTable
    statsDetermines whether to collect statistics (and expose them via JMX). Default is true
    tcp_nodelayShould TCP no delay flag be turned on
    thread_naming_patternThread naming pattern for threads in this channel. Default is cl
    thread_pool.keep_alive_timeTimeout in milliseconds to remove idle thread from regular pool
    thread_pool.max_threadsMaximum thread pool size for the regular thread pool
    thread_pool.min_threadsMinimum thread pool size for the regular thread pool
    thread_pool_enabledSwitch for enabling thread pool for regular messages. Default true
    thread_pool_queue_enabledUse queue to enqueue incoming regular messages. Default is true
    thread_pool_queue_max_sizeMaximum queue size for incoming OOB messages. Default is 500
    thread_pool_rejection_policyThread rejection policy. Possible values are Abort, Discard, DiscardOldest and Run. Default is Discard
    use_local_hostIgnores all bind address parameters and  let's the OS return the local host address
    use_send_queuesShould 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.

     

     

    Back To JGroups