【问题标题】:Spring jms ListenerContainer with AMQP using Qpid client throwing Exception while connecting to Azure Service bus partitioned TopicSpring jms ListenerContainer 与 AMQP 使用 Qpid 客户端在连接到 Azure 服务总线分区主题时抛出异常
【发布时间】:2017-10-27 21:13:55
【问题描述】:

我正在使用 AMQP 将 azure Service bus 与 java qpid 客户端以及 Spring JMS 连接起来。

我将服务总线扩展到高级层,因为默认情况下主题是分区的,并且无法从门户或 Azure 服务总线管理库修改我在 SimpleMessageListenerContainer 开始时面临以下问题。

javax.jms.JMSException无法为实体类型订阅者打开主题客户端。 TrackingId:74bcb8d5-5d05-4239-9dad-cb2133015c29_B19, SystemTracker:servicebus-topic:topic:dumb-pipe~127|sink-alpha-test-processing-subscription, Timestamp:5/22/2017 2:40:45 PM TrackingId :f572fcfb24dc47bf9ef3968bdfa99666_G17, SystemTracker:gateway2, Timestamp:5/22/2017 2:40:44 PM [条件 = amqp:not-allowed]

后跟:-

2017-05-22 16:40:44.772  INFO 14268 --- [windows.net:-1]] o.a.q.j.s.SaslMechanismFinder            : Best match for SASL auth was: SASL-PLAIN
2017-05-22 16:40:45.376  INFO 14268 --- [windows.net:-1]] o.a.q.j.JmsConnection                    : Connection ID:c27375bc-e3e2-41a9-90a4-8e1bb1e17f8a:1 connected to remote Broker: amqps://servicebus-topic.servicebus.windows.net?amqp.idleTimeout=500000

2017-05-22 16:40:45.377  INFO 14268 --- [           main] o.s.j.c.CachingConnectionFactory         : Established shared JMS Connection: org.apache.qpid.jms.JmsConnection@805849

2017-05-22 16:40:46.499  WARN 14268 --- [windows.net:-1]] o.a.q.j.p.a.b.AmqpResourceBuilder        : Open of resource:(JmsConsumerInfo: { ID:c27375bc-e3e2-41a9-90a4-8e1bb1e17f8a:1:1:1, destination = dumb-pipe }) failed: Cannot open a Topic client for entity type Subscriber. TrackingId:74bcb8d5-5d05-4239-9dad-cb2133015c29_B19, SystemTracker:servicebus-topic:topic:dumb-pipe~127|sink-alpha-test-processing-subscription, Timestamp:5/22/2017 2:40:45 PM TrackingId:f572fcfb24dc47bf9ef3968bdfa99666_G17, SystemTracker:gateway2, Timestamp:5/22/2017 2:40:44 PM [condition = amqp:not-allowed]

2017-05-22 16:40:46.520  WARN 14268 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'domainListenerContainer' defined in class path resource [ServiceBusConfig.class]: Invocation of init method failed; nested exception is org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Cannot open a Topic client for entity type Subscriber. TrackingId:74bcb8d5-5d05-4239-9dad-cb2133015c29_B19, SystemTracker:servicebus-topic:topic:dumb-pipe~127|sink-alpha-test-processing-subscription, Timestamp:5/22/2017 2:40:45 PM TrackingId:f572fcfb24dc47bf9ef3968bdfa99666_G17, SystemTracker:gateway2, Timestamp:5/22/2017 2:40:44 PM [condition = amqp:not-allowed]

请注意,使用未分区主题时,一切似乎都很好(生产者和消费者)。

我发现现在 AMQP 协议支持分区实体,Azure 服务总线check Latest added features from service bus documentation

【问题讨论】:

    标签: java azure jms amqp azureservicebus


    【解决方案1】:

    您可能已使用默认设置创建主题并启用启用分区。在关闭分区的情况下重新创建主题,一切正常。

    您可以按照博客中给出的示例进行操作,

    http://ramblingstechnical.blogspot.in/p/using-azure-service-bus-with-spring-jms.html

    【讨论】:

      【解决方案2】:

      How to use the Java Message Service (JMS) API with Service Bus and AMQP 1.0 有一个 Azure 官方教程。如果你对spring-jms很熟悉的话,我想你可以尝试将教程中的示例代码(基于geronimo jms,一种JMS标准的实现)与Spring JMS集成来连接Azure服务总线分区主题。

      【讨论】:

        猜你喜欢
        • 2013-03-18
        • 2015-02-25
        • 2016-08-28
        • 1970-01-01
        • 2020-11-14
        • 2015-09-12
        • 1970-01-01
        • 2013-02-05
        • 2017-08-15
        相关资源
        最近更新 更多