【问题标题】:Springboot application unable to recover after jms connection failurejms连接失败后Spring Boot应用程序无法恢复
【发布时间】:2021-11-10 12:24:56
【问题描述】:

我们有一个 sprinboot 应用程序,它在 3 次连接尝试后停止重试连接安慰队列。我们记录了以下信息,然后应用程序没有响应,我们必须重新启动应用程序:

2021-09-15 16:49:08.021  INFO 4444 --- [recovery-thread] bitronix.tm.recovery.Recoverer           : recoverer is already running, abandoning this recovery request
2021-09-15 16:50:04.862  INFO 4444 --- [connect_service] c.s.j.protocol.impl.TcpClientChannel     : Connection attempt failed to host '<<hostname>>' ReconnectException com.solacesystems.jcsmp.JCSMPSecurityException: Error performing login to LoginContext (*****) cause: javax.security.auth.login.LoginException: *****
2021-09-15 16:50:07.865  INFO 4444 --- [connect_service] c.s.j.protocol.impl.TcpClientChannel     : Connecting to host 'orig=tcp://<<hostname>>:55555, scheme=tcp://, host=<<hostname>>, port=55555' (host 1 of 1, smfclient 2, attempt 3 of 3, this_host_attempt: 1 of 1)
2021-09-15 16:50:07.877  INFO 4444 --- [connect_service] c.s.j.protocol.impl.TcpClientChannel     : Connection attempt failed to host '<<hostname>>' ReconnectException com.solacesystems.jcsmp.JCSMPSecurityException: Error performing login to LoginContext (*****) cause: javax.security.auth.login.LoginException: *****
2021-09-15 16:50:10.878  INFO 4444 --- [connect_service] c.s.j.protocol.impl.TcpClientChannel     : Stale reconnect task, aborting reconnect.

下面是我们连接慰问队列的配置:

spring.jta.bitronix.connectionfactory.className=com.solacesystems.jms.SolXAConnectionFactoryImpl
spring.jta.bitronix.connectionfactory.driverProperties.host=smf://<<hostname>>:55555
spring.jta.bitronix.connectionfactory.driverProperties.VPN=<<vpn>>
spring.jta.bitronix.connectionfactory.driverProperties.authenticationScheme=AUTHENTICATION_SCHEME_GSS_KRB
spring.jta.bitronix.connectionfactory.driverProperties.KRBServiceName=HOST

在我们的服务类中,我们只是自动装配 jmsTemplate 的对象并在队列上发布消息。

我浏览了一些文档并尝试添加以下配置:

spring.jta.bitronix.connectionfactory.ignore-recovery-failures=true

但我仍然面临同样的问题。任何建议

====编辑

只有当我将笔记本电脑置于飞行模式并重新连接时,我才会遇到此问题。如果我只是断开 VPN 并重新连接,那么安慰连接将重新建立

【问题讨论】:

    标签: spring-boot solace


    【解决方案1】:

    SolXAConnectionFactory 接口允许您调整连接和重新连接参数。文档here.

    您会想要查看这些,也许还有其他一些。我建议在 javadoc 中搜索“重试”和“重试”:

    • connectRetries
    • connectRetriesPerHost
    • connectTimeoutInMillies
    • 重新连接重试

    【讨论】:

    • 谢谢你能在我有问题的编辑后提出一些建议
    【解决方案2】:

    我做了更多研究,发现以下内容很有帮助,将在我的应用程序中尝试:https://solace.community/discussion/917/why-won-t-my-solace-enterprise-application-reconnect-after-an-ha-failover 要在 JNDI 中设置它,我认为这也应该在 SolAdmin -> JMS 管理 -> 连接工厂 -> 传输属性中进行配置.

    【讨论】:

    • 谢谢你能在我有问题的编辑后提出一些建议
    【解决方案3】:

    在浏览了各种文档并进行了一些尝试和试验之后,以下属性变得非常有用。希望它可以帮助某人:

    spring.jta.bitronix.connectionfactory.driverProperties.reconnectRetries = -1
    spring.jta.bitronix.connectionfactory.driverProperties.connectRetries = -1
    

    【讨论】:

      猜你喜欢
      • 2019-06-22
      • 2019-08-06
      • 2021-03-21
      • 2020-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-22
      • 2020-06-16
      相关资源
      最近更新 更多