简体   繁体   English

Tibco 无法追踪的断开连接

[英]Tibco untraceable deconnection

In our production environment we are facing a strange problem with Tibco and Spring JMS.在我们的生产环境中,我们面临着一个关于 Tibco 和 Spring JMS 的奇怪问题。 Randomly during the week our MessageListener implementation of Spring JMS (Spring Boot 2.5.2) no longer receives messages from the server although queues have messages.尽管队列中有消息,但随机在一周内我们的 Spring JMS(Spring Boot 2.5.2)的MessageListener实现不再从服务器接收消息。 However, no client-side disconnection error is reported so the listener is still listening.但是,没有报告客户端断开连接错误,因此侦听器仍在侦听。

Do you have an idea?你有好主意吗? Does Spring JMS have a "auto reconnection" mechanism without explicit disconnection by the server? Spring JMS 是否具有“自动重连”机制,无需服务器显式断开连接? Or other idea to solve the problem?或其他解决问题的想法? We also use com.tibco.tibjms tibjms 8.0.0 jar and tibco-ems tibcrypt 4.1 jar.我们还使用 com.tibco.tibjms tibjms 8.0.0 jar 和 tibco-ems tibcrypt 4.1 jar。

thank a lot, Adrien非常感谢,阿德里安

Do you set the receiveTimeout on the org.apache.camel.component.jms.JmsComponent ?您是否在receiveTimeout上设置了org.apache.camel.component.jms.JmsComponent This timeout specifies how long the message listener will wait to receive a message.此超时指定消息侦听器等待接收消息的时间。 If this timeout expires, then the message listener will be dropped and reestablished.如果此超时到期,则消息侦听器将被删除并重新建立。

The default value is one second, which is often much to low as this causes frequent connection drops and re-connections when there are no messages on the destination.默认值为 1 秒,这通常非常低,因为当目的地没有消息时,这会导致频繁的连接断开和重新连接。

A possible explanation to this behavior is a loss of connectivity at.network level that would be undetected in the EMS client library.对此行为的一个可能解释是在 EMS 客户端库中检测不到的网络级别连接丢失。

To manage this you need to do two things:要管理它,您需要做两件事:

#1 At EMS server level add the following properties in tibemsd.conf file: #1 在 EMS 服务器级别,在 tibemsd.conf 文件中添加以下属性:

client_heartbeat_server = 20

server_timeout_client_connection = 90

server_heartbeat_client = 20

client_timeout_server_connection = 90

Those properties enable some EMS mechanisms that allows to detect the loss of connectivity between the EMS server and the client applications.这些属性启用了一些 EMS 机制,允许检测 EMS 服务器和客户端应用程序之间的连接丢失。

#2 At your application level you should add the following properties in the JVM parameters: #2 在您的应用程序级别,您应该在 JVM 参数中添加以下属性:

-Dcom.tibco.tibjms.connect.attempts 6, 10000 -Dcom.tibco.tibjms.reconnect.attempts 12, 10000 -Dcom.tibco.tibjms.connect.attempts 6, 10000 -Dcom.tibco.tibjms.reconnect.attempts 12, 10000

Also if you are using connection factories you should add the following properties to each of the factories used by your application:此外,如果您正在使用连接工厂,则应将以下属性添加到应用程序使用的每个工厂:

addprop factory <YourFactory> url=tcp://<YourServer1>:7222,tcp://<YourServer2>:7222

addprop factory <YourFactory> connect_attempt_count=6

addprop factory <YourFactory> connect_attempt_delay=10000

addprop factory <YourFactory> connect_attempt_timeout=1000

addprop factory <YourFactory> reconnect_attempt_count=12

addprop factory <YourFactory> reconnect_attempt_delay=10000

addprop factory <YourFactory> reconnect_attempt_timeout=1000

Those properties control the reconnection mechanisms available in the EMS client library.这些属性控制 EMS 客户端库中可用的重新连接机制。

With the above you should be able to detect loss of connectivity and reconnect automatically.通过以上内容,您应该能够检测到连接丢失并自动重新连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM