public class JCSMPChannelProperties extends Object implements Cloneable, Serializable
JCSMPChannelProperties
describes the properties required to
create a channel connection with a Solace appliance.
Name | Default | Description |
---|---|---|
stack | SUPPORTED_PROTOCOL_STACK_SMF_TCP |
Could be one of |
smfPort | 0 | The appliance SMF port number. Valid values are 0-65535; 0 means
"use default". Calling getSmfPort() will return the
currently set SMF port number. If 0 (the default setting) is used for
smfPort , the automatically set port number is returned. The port number depends on the
value of compressionLevel ; (smfPort is
55555 if compression is not enabled, and 55003 if compression is enabled.)
Note that use of this property is discouraged, and new applications should
use the format "Host:Port" when specifying the |
connectTimeoutInMillis | 30000 | Timeout value (in ms) for creating an initial connection to the appliance. Valid values are >= 0. 0 means an infinite timeout. |
readTimeoutInMillis | 10000 | Timeout value (in ms) for reading a reply from the appliance. Valid values are > 0.
Note: For subscriber control channels, the default is 120000 ms. |
connectRetries | 0 | The number of times to attempt and retry a connection to the host appliance (or list of appliances)
during initial connection setup.
See the Valid values are >= -1. Zero means no automatic connection retries (that is, try once and give up). -1 means "retry forever". |
reconnectRetries | 3 | The number of times to attempt to reconnect to the appliance (or list of appliances)
after an initial connected session goes down.
See the Valid values are >= -1. -1 means "retry forever". 0 means no automatic reconnection retries (that is, try once and give up). |
connectRetriesPerHost | 0 |
When using a host list for the HOST property,
this property defines how many times to try to connect or reconnect to
a single host before moving to the next host in the list.
NOTE: This property works in conjunction with the connect and reconnect
retries settings; it does not replace them.
Valid values are >= -1. 0 means make a single connection attempt (that is, 0 retries). -1 means attempt an infinite number of reconnect retries (that is, the API only tries to connect or reconnect to first host listed.) |
reconnectRetryWaitInMillis | 3000 | How much time in (MS) to wait between each attempt to connect or
reconnect to a host. If a connect or reconnect attempt to host is not
successful, the API waits for the amount of time set for
reconnectRetryWaitInMillis, and then makes another connect or reconnect
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 Valid values are 0 - 60000, inclusively. |
keepAliveIntervalInMillis | 3000 | The amount of time (in ms) to wait between sending out keep-alive
messages. Typically, this feature should be enabled for message receivers. Valid values are >= 50. 0 disables the keepalive function. Note: If using compression on a session, the configured KeepAlive interval should be longer than the maximum time required to compress the largest message likely to be published. |
keepAliveLimit | 10 | The maximum number of consecutive keep-alive messages that can be sent without receiving a
response before the connection is closed by the API. Valid values are >= 3. |
sendBuffer | 65536 | The size (in bytes) of the send socket buffer. |
receiveBuffer | 65536 | The size (in bytes) of the receive socket buffer. |
tcpNoDelay | true | Whether to set the TCP_NODELAY option. When enabled, this option disables the Nagle's algorithm. |
compressionLevel | 0 |
A compressionLevel setting of 1-9 sets the ZLIB compression
level to use; a setting of 0 disables compression entirely.
From the ZLIB manual:
Note: If using compression on a session, the configured KeepAlive interval should be longer than the maximum time required to compress the largest message likely to be published. |
NOTE: Disabling keep-alive and reconnect retries has a negative impact during Active/Active failover.
NOTE: Reconnect retries are mostly useful as a recovery mechanism when appliances are in Active/Active configurations. Otherwise, it is up to the application to implement reconnect logic.
*: Not supported in this version.
Modifier and Type | Field and Description |
---|---|
static String |
COMPRESSION_LEVEL |
static String |
CONNECT_RETRIES |
static String |
CONNECT_RETRIES_PER_HOST |
static String |
CONNECT_TIMEOUT_IN_MILLIS |
static String |
KEEP_ALIVE_INTERVAL_IN_MILLIS |
static String |
KEEP_ALIVE_LIMIT |
static String |
READ_TIMEOUT_IN_MILLIS |
static String |
RECEIVE_BUFFER |
static String |
RECONNECT_RETRIES |
static String |
RECONNECT_RETRY_WAIT_IN_MILLIS |
static String |
SEND_BUFFER |
static String |
SMF_PORT |
static String |
STACK |
static String |
SUPPORTED_PROTOCOL_STACK_SMF_TCP |
static String |
SUPPORTED_PROTOCOL_STACK_SMFS_TCP |
static String |
TCP_NO_DELAY |
Constructor and Description |
---|
JCSMPChannelProperties()
Construct a default
JCSMPChannelProperties . |
JCSMPChannelProperties(String stack,
int smfPort,
int connectTimeoutInMillis,
int readTimeoutInMillis,
int reconnectRetries,
int reconnectRetryWaitInMillis,
int keepAliveIntervalInMillis) |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Copy properties to a newly-created instance.
|
boolean |
equals(Object o) |
Boolean |
getBooleanProperty(String name) |
int |
getCompressionLevel() |
int |
getConnectRetries() |
int |
getConnectRetriesPerHost() |
int |
getConnectTimeoutInMillis() |
Integer |
getIntegerProperty(String name) |
int |
getKeepAliveIntervalInMillis() |
int |
getKeepAliveLimit() |
Map<String,Object> |
getProperties() |
Object |
getProperty(String name) |
int |
getReadTimeoutInMillis() |
int |
getReceiveBuffer() |
int |
getReconnectRetries() |
int |
getReconnectRetryWaitInMillis() |
int |
getSendBuffer() |
int |
getSmfPort()
Deprecated.
Use of this setting is discouraged, the recommended way of
selecting ports is through the "Host:Port" syntax of the
JCSMPProperties.HOST property. |
String |
getStack() |
String |
getStringProperty(String name) |
int |
hashCode() |
boolean |
isSecureChannel()
Deprecated.
|
boolean |
isTcpNoDelay() |
Set<String> |
propertyNames() |
Object |
setBooleanProperty(String name,
boolean value) |
void |
setCompressionLevel(int compressionLevel) |
void |
setConnectRetries(int connectRetries) |
void |
setConnectRetriesPerHost(int connectRetriesPerHost) |
void |
setConnectTimeoutInMillis(int connectTimeoutInMillis) |
Object |
setIntegerProperty(String name,
int value) |
void |
setKeepAliveIntervalInMillis(int keepAliveIntervalInMillis) |
void |
setKeepAliveLimit(int keepAliveLimit) |
void |
setProperties(Map<String,Object> properties) |
Object |
setProperty(String name,
Object value) |
void |
setReadTimeoutInMillis(int readTimeoutInMillis) |
void |
setReceiveBuffer(int so_rcvbuf) |
void |
setReconnectRetries(int reconnectRetries) |
void |
setReconnectRetryWaitInMillis(int reconnectRetryWaitInMillis) |
void |
setSendBuffer(int so_sendbuf) |
void |
setSmfPort(int smfPort)
Deprecated.
Use of this setting is discouraged, the recommended way of
selecting ports is through the "Host:Port" syntax of the
JCSMPProperties.HOST property. |
void |
setStack(String stack) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
String |
toString() |
public static final String SUPPORTED_PROTOCOL_STACK_SMF_TCP
public static final String SUPPORTED_PROTOCOL_STACK_SMFS_TCP
public static final String CONNECT_TIMEOUT_IN_MILLIS
public static final String SMF_PORT
public static final String KEEP_ALIVE_INTERVAL_IN_MILLIS
public static final String KEEP_ALIVE_LIMIT
public static final String READ_TIMEOUT_IN_MILLIS
public static final String CONNECT_RETRIES
public static final String RECONNECT_RETRIES
public static final String RECONNECT_RETRY_WAIT_IN_MILLIS
public static final String STACK
public static final String TCP_NO_DELAY
public static final String SEND_BUFFER
public static final String RECEIVE_BUFFER
public static final String COMPRESSION_LEVEL
public static final String CONNECT_RETRIES_PER_HOST
public JCSMPChannelProperties()
JCSMPChannelProperties
.public JCSMPChannelProperties(String stack, int smfPort, int connectTimeoutInMillis, int readTimeoutInMillis, int reconnectRetries, int reconnectRetryWaitInMillis, int keepAliveIntervalInMillis)
public Object clone()
public String toString()
@Deprecated public boolean isSecureChannel()
*: This feature is not supported in this version. It is present for future expansion.
true
If the channel needs to use SSL/TLS.public int getConnectTimeoutInMillis()
public void setConnectTimeoutInMillis(int connectTimeoutInMillis)
public int getSmfPort()
JCSMPProperties.HOST
property.public void setSmfPort(int smfPort)
JCSMPProperties.HOST
property.smfPort
- port numberpublic int getKeepAliveIntervalInMillis()
public void setKeepAliveIntervalInMillis(int keepAliveIntervalInMillis)
public int getKeepAliveLimit()
public void setKeepAliveLimit(int keepAliveLimit)
public int getReadTimeoutInMillis()
public void setReadTimeoutInMillis(int readTimeoutInMillis)
public int getConnectRetries()
public void setConnectRetries(int connectRetries)
public int getReconnectRetries()
public void setReconnectRetries(int reconnectRetries)
public int getReconnectRetryWaitInMillis()
public void setReconnectRetryWaitInMillis(int reconnectRetryWaitInMillis)
public String getStack()
public void setStack(String stack)
public boolean isTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
public int getSendBuffer()
public void setSendBuffer(int so_sendbuf)
public int getReceiveBuffer()
public void setReceiveBuffer(int so_rcvbuf)
public int getCompressionLevel()
public void setCompressionLevel(int compressionLevel)
public void setConnectRetriesPerHost(int connectRetriesPerHost)
public int getConnectRetriesPerHost()
Copyright 2004-2024 Solace Corporation. All rights reserved.