@ProviderType
public static interface SolaceProperties.TransportLayerProperties
MessagingService
instances. The properties are for use with MessagingServiceClientBuilder.fromProperties(Properties)
.
Example usage:
final Properties transportProperties = new Properties();
transportProperties.setProperty(TransportLayerProperties.HOST, AuthenticationConstants.AUTHENTICATION_SCHEME_BASIC);
transportProperties.setProperty(TransportLayerProperties.CONNECTION_RETRIES, "5");
transportProperties.setProperty(TransportLayerProperties.CONNECTION_ATTEMPTS_TIMEOUT, "5000");
final MessagingServiceClientBuilder serviceBuilder = new MessagingServiceClientBuilder(ConfigurationProfile.V1);
final MessagingService service = serviceBuilder.fromProperties(transportProperties).build();
MessagingServiceClientBuilder.fromProperties(Properties)
Modifier and Type | Field and Description |
---|---|
static String |
COMPRESSION_LEVEL
A property key to specify the compression level; A compression level setting of 1-9 sets the
ZLIB compression level to use; while a setting of zero (0) disables compression entirely.
|
static String |
CONNECTION_ATTEMPTS_TIMEOUT
A property key to specify a timeout value (in milliseconds) for creation of an initial
connection to the appliance.
|
static String |
CONNECTION_RETRIES
A property key to specify the number of times to attempt to establish a connection to the
host appliance (or list of appliances) during initial connection setup.
|
static String |
CONNECTION_RETRIES_PER_HOST
A property key to specify the number of times to attempt to connect or reconnect to a single
host before moving to the next host in the list.
|
static String |
HOST
A property key to specify the IP address (or hostname) for which to connect.
|
static String |
KEEP_ALIVE_INTERVAL
A property key to specify the amount of time (in milliseconds) to wait between sending out
keep-alive messages.
|
static String |
KEEP_ALIVE_WITHOUT_RESPONSE_LIMIT
A property key to specify the maximum number of consecutive keep-alive messages that can be
sent without receiving a response before the connection is closed by the API.
|
static String |
LOCAL_ADDRESS
A property key recommended to be set on multi-homed hosts (though optional).
|
static String |
RECONNECTION_ATTEMPTS
A property key to specify the number of times to attempt to reconnect to the appliance (or
list of appliances) after an initial connected session goes down.
|
static String |
RECONNECTION_ATTEMPTS_WAIT_INTERVAL
A property key to specify how much time (in milliseconds) to wait between each attempt to
connect or reconnect to a host.
|
static String |
SOCKET_INPUT_BUFFER_SIZE
A property key to specify the size (in bytes) of the receive socket buffer.
|
static String |
SOCKET_OUTPUT_BUFFER_SIZE
A property key to specify the size (in bytes) of the send socket buffer.
|
static String |
SOCKET_TCP_OPTION_NO_DELAY
A property key to specify value for
Socket.setTcpNoDelay(boolean) , where
true to enable TCP_NODELAY , otherwise false to disable. |
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_COMPRESSION_LEVEL", valueType=int.class) static final String COMPRESSION_LEVEL
From the ZLIB manual:
[...] 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied one block at a time).
Note: When using compression on a session, the configured KeepAlive interval should be longer than the maximum time required to compress the largest message that's most likely to be published.
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_CONNECT_TIMEOUT_IN_MILLIS", valueType=int.class) static final String CONNECTION_ATTEMPTS_TIMEOUT
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_CONNECT_RETRIES", valueType=int.class) static final String CONNECTION_RETRIES
SolaceProperties.TransportLayerProperties.HOST
about the details on the reconnection logic. The valid
values are >= -1. A value of zero (0) indicates that no automatic connection
retries are attempted. (i.e., that is, try once and give up). A value of -1 means to attempt
an infinite number of retries.@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_CONNECT_RETRIES_PER_HOST", valueType=int.class) static final String CONNECTION_RETRIES_PER_HOST
Note: This property works in conjunction with the connect and reconnect retries settings, but it does not replace them. The valid values are >= -1. A value of zero (0) indicates to make a single connection attempt (that is, 0 retries). A value of -1 indicates to attempt an an infinite number of reconnect retries (i.e., that is, the API only tries to connect or reconnect to first listed host).
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="HOST", valueType=java.lang.String.class) static final String HOST
The host entry has the following format: [Protocol:]Host[:Port]
- [Protocol]
is the protocol used for the transport channel, it is an optional
parameter. Supported values are: tcp
- for an insecure TCP channel to be used, tcps
for SSL secure TCP channel to be used. @code ws} for an insecured WebSocket channel to be used
(note that compression is not supported if a WebSocket channel is used). @code wss} for a TLS secure WebSocket
channel to be used (note that compression is not supported if a secured WebSocket channel is used).
If no protocol is set, tcp
the default.
- Host
is the IP address (or hostname) for which to connect.
- [Port]
is the port number for which to connect. It is optional parameter. Port
needs to be specified if default values are overridden. The default port for TCP is 55555
when compression is not in use, or 55003 when compression is in use.The default port for SSL is 55443.
The default port for WebSocket is 80. The default port for TLS secured WebSocket is 443.
Usage examples, unless it is otherwise specified, port 55555 is used (default):
192.168.160.28 - connect to IP address 192.168.160.28 over TCP.
tcp:192.168.160.28 - connect to IP address 192.168.160.28 over TCP.
tcps:192.168.160.28 - connect to IP address 192.168.160.28 and port 55443 over SSL over TCP.
ws:192.168.160.28 - connect to IP address 192.168.160.28 and port 80 over WebSocket.
wss:192.168.160.28 - connect to IP address 192.168.160.28 and port 443 over TLS over WebSocket.
tcp:192.168.160.28:77777 - connect to IP address 192.168.160.28 and port 77777 over TCP.
ws:192.168.160.28:77777 - connect to IP address 192.168.160.28 and port 77777 over WebSocket.
Configuring Multiple Hosts for Redundancy and Failover
Usage of a host list allows applications to connect to alternate connections should the first appliance be unavailable. The host list is configured as a comma-separated list of hosts.
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_KEEP_ALIVE_INTERVAL_IN_MILLIS", valueType=int.class) static final String KEEP_ALIVE_INTERVAL
Note: If using compression on a session, the configured KeepAlive interval should be longer than the maximum time required to compress the largest message that's most likely to be published.
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_KEEP_ALIVE_LIMIT", valueType=int.class) static final String KEEP_ALIVE_WITHOUT_RESPONSE_LIMIT
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="LOCALHOST", valueType=java.lang.String.class) static final String LOCAL_ADDRESS
bind
operation.@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_RECONNECT_RETRIES", valueType=int.class) static final String RECONNECTION_ATTEMPTS
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_RECONNECT_RETRY_WAIT_IN_MILLIS", valueType=int.class) static final String RECONNECTION_ATTEMPTS_WAIT_INTERVAL
reconnectRetryWaitInMillis
,
and then makes another connection or reconnection attempt.
Note: connectRetriesPerHost
sets how many connection or
reconnection attempts can be made before moving on to the next host in the list. See the HOST
for more details on the reconnection logic. The allowed values are from 0 to 60000,
inclusively.
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_RECEIVE_BUFFER", valueType=int.class) static final String SOCKET_INPUT_BUFFER_SIZE
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_SEND_BUFFER", valueType=int.class) static final String SOCKET_OUTPUT_BUFFER_SIZE
@PropertiesKeyMapping(mappedClass=com.solacesystems.jcsmp.JCSMPProperties.class, mappedFieldName="CLIENT_CHANNEL_PROPERTIES_TCP_NO_DELAY", valueType=boolean.class) static final String SOCKET_TCP_OPTION_NO_DELAY
Socket.setTcpNoDelay(boolean)
, where
true
to enable TCP_NODELAY
, otherwise false
to disable.Copyright 2019-2024 Solace Corporation. All rights reserved.