java - 无法使用 JMS 连接 Azure 服务总线主题 - Java

标签 java spring-boot azure azure-servicebus-topics jms-topic

我按照Azure ServiceBus JMS Sample中提到的步骤进行操作具有以下属性

spring.jms.servicebus.connection-string=Endpoint=sb://test-dt.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=key
spring.jms.servicebus.topic-client-id=12345
spring.jms.servicebus.idle-timeout=18000
spring.jms.servicebus.pricing-tier=Standard

但是我收到以下错误

ERROR 43904 --- [ntContainer#0-1] org.apache.qpid.jms.JmsConnection        : Failed to connect to remote at: amqps://test-dt.servicebus.windows.net:-1
ERROR 43904 --- [ntContainer#0-1] o.s.j.l.DefaultMessageListenerContainer  : Could not refresh JMS Connection for destination 'test-topic' - retrying using FixedBackOff{interval=5000, currentAttempts=6, maxAttempts=unlimited}. Cause: handshake timed out after 10000ms

另一方面,我按照ServiceBus without JMS中提到的步骤进行操作。并将 TransportType 添加为 AmqpTransportType.AMQP_WEB_SOCKETS 然后我就可以连接了。

我们希望使用 spring boot starter 和监听器方法来实现,而不是从 (public static void main) 方法调用。

请指导我在点击第一个链接时缺少什么

最佳答案

ERROR 43904 --- [ntContainer#0-1] org.apache.qpid.jms.JmsConnection : Failed to connect to remote at: amqps://test-dt.servicebus.windows.net:-1

要解决上述错误,请按照 Anand Sowmithiran 的建议进行尝试:

检查端口5671是否被阻止:

telnet <yournamespacename>.servicebus.windows.net 5671

注意:通过 TCP 使用 AMQP 连接的客户端需要在防火墙中打开端口 56715672。除了这些端口之外,如果 EnableLinkRedirect 可能还需要打开其他端口。功能已启用。

您可以引用Troubleshooting guide for Azure Service Bus , AMQP outbound port requirementsPort 5671 Blocked :(. What are other options?

关于java - 无法使用 JMS 连接 Azure 服务总线主题 - Java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71953804/

相关文章:

java - 如何拥有动态数量的生产者和消费者?

java - Spring Boot 1.5+ junit 测试不加载具有自定义名称的配置

azure - 如何从 VS Code 发布到 Azure 中的开发槽

node.js - 解析 Azure 函数中的 URL

java - 如何在MyEclipse下的Jboss中增加-XXMaxPermGen jvm设置?

java - BerkeleyDB 写入性能问题

java - web3J 与 infura 的兼容性

java - 如何拦截使用 WebClient/WebFlux 形成的所有传出 HTTP 请求?

spring-boot - Thymeleaf Temporals 和日期与时区

azure - 使用 Silverlight 中的 Windows Azure 服务总线