java - TibjmsConnectionFactory 的 connAttemptCount 和 reconnAttemptCount 有什么区别?

标签 java spring jms spring-jms tibco-ems

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/

相关文章:

java - 分离后可以将调试器附加到 Java 进程吗?

java - 下载文件 java spring rest api

java - 为 ActiveMQ JMS 连接使用用户名和密码

java - 使用 JDBC 和 c3p0 在 MySQL DB 上进行多线程写入

java - Android Force 在 io.realm 库上使用 ARMv7

java - 如何使用 Java 将灰度二维矩阵打印到 JPanel

java - 缓存刷新显示带有@cacheable 注释的错误

java - 为什么 HATEOAS 在使用 Swagger 2.x 启动期间开始为 spring-boot 版本 >= 2.2.x 创建问题?

java - 默认情况下 JMS 使用 HTTP?

migration - Apache Kafka 是 JMS 的另一个 API 吗?