带有Qpid的Windows Service Bus

时间:2017-05-16 13:55:57

标签: windows service amqp bus

我正在尝试使用AMQP为我的项目实现Windows Service Bus 1.1,     我已经安装了Windows Service Bus 1.1并使用Service Bus Explorer创建了名为test的Queue,     我正在使用以下链接中给出的Java程序测试示例服务总线功能,

https://msdn.microsoft.com/en-us/library/dn574799.aspx

In the example given above link i have removed if else code starting with if(type.compareTo("onprem") == 0) and hard coded my connection string.

并按以下方式创建制作人

目的地que =(目的地)context.lookup(“QUEUE”); //阅读表单属性文件

producer = session.createProducer(que);

My connection string and Queue name looks like the below one
connectionstring = amqps://username:pwd@machinename/SampleNameSpace
QueueName = SampleNameSpace/test

When i run the Java program i am getting the ConcurrentTimeOutException when creating the producer.
I am pretty much new to the Service Bus thing and i tried to find out some solution online but it wasn't successful.

Below is my console log

Initial setup

Creating context

Creating connection factory

Creating connection

Creating session

Creating queue

Creating producer

Exception creating producer
javax.jms.JMSException: java.util.concurrent.TimeoutException
    at org.apache.qpid.amqp_1_0.jms.impl.MessageProducerImpl.<init>(MessageProducerImpl.java:98)
    at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.createProducer(SessionImpl.java:390)
    at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.createProducer(SessionImpl.java:59)
    at prerna.jms.test.SBTest.main(SBTest.java:71)
Caused by: org.apache.qpid.amqp_1_0.client.Sender$SenderCreationException: java.util.concurrent.TimeoutException
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:178)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:119)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:112)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:98)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:84)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:78)
    at org.apache.qpid.amqp_1_0.client.Session$1.<init>(Session.java:90)
    at org.apache.qpid.amqp_1_0.client.Session.createSender(Session.java:89)
    at org.apache.qpid.amqp_1_0.jms.impl.MessageProducerImpl.<init>(MessageProducerImpl.java:86)
    ... 3 more
Caused by: java.util.concurrent.TimeoutException
    at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.waitUntil(ConnectionEndpoint.java:1232)
    at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.waitUntil(ConnectionEndpoint.java:1214)
    at org.apache.qpid.amqp_1_0.transport.SessionEndpoint.waitUntil(SessionEndpoint.java:681)
    at org.apache.qpid.amqp_1_0.transport.LinkEndpoint.waitUntil(LinkEndpoint.java:355)
    at org.apache.qpid.amqp_1_0.client.Sender.<init>(Sender.java:167)
    ... 11 more


Any help will be greatly appreciated.

1 个答案:

答案 0 :(得分:0)

您似乎正在使用Qpid项目中不再受支持的旧版AMQP 1.0 JMS客户端。我建议的第一件事是切换到更新的AMQP 1.0 JMS客户端,您可以在Qpid site找到它。

这里是在Github上镜像的Qpid JMS客户端示例的link,这里是你的maven dep应该是什么样的。

<dependency>
  <groupId>org.apache.qpid</groupId>
  <artifactId>qpid-jms-client</artifactId>
  <version>0.23.0</version>
</dependency>