documentation具有以下内容:
setConnAttemptCount - attempts - 连接对象尝试与服务器建立连接的次数。
setReconnAttemptCount - attempts - 连接对象尝试重新建立与服务器的连接的次数。
connAttemptCount是初始尝试和连接后重新连接以及丢失连接吗?
还有一些其他属性需要连接和重新连接,但我想一旦回答了上述问题,我也会知道其他属性:
<bean id="tibcoJmsConnectionFactory" class="com.tibco.tibjms.TibjmsConnectionFactory">
<property name="serverUrl" value="${tibco.server.url}"/>
<property name="userName" value="${tibco.user}"/>
<property name="userPassword" value="${tibco.password}"/>
<property name="connAttemptCount" value="2"/>
<property name="connAttemptDelay" value="100"/>
<property name="connAttemptTimeout" value="1000"/>
<property name="reconnAttemptCount" value="4"/>
<property name="reconnAttemptDelay" value="100"/>
<property name="reconnAttemptTimeout" value="1000"/>
</bean>
最佳答案
你的理解是正确的。 documentation setReconnectAttemptTimeout()
API 调用解释了重新连接与初始连接需要单独的配置设置:
This parameter is similar to setConnectAttemptTimoeut The difference is that it may be necessary to use different parameters during reconnect than during the initial connect. Initial connect of the clients to the server is normally distributed in time and there are less chances of the server exceeding its maximum accept queue. During fault-tolerant switch, all connected clients automatically try to reconnect to the backup server, approximately at the same time. When the number of connections is large, it may require more reconnect time to reconnect than the initial connect.
关于java - TibjmsConnectionFactory 的 connAttemptCount 和 reconnAttemptCount 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26775976/