0

I was trying to implement Windows Service Bus 1.1 with AMQP for my project, I have installed Windows Service Bus 1.1 and created a Queue with the name test using Service Bus Explorer, I am testing the sample Service bus functionality with the Java program given in the below link,

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.

And creating the producer as below

Destination que = (Destination) context.lookup("QUEUE"); // reading form properties file

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.
  • were you able to get it to work.. can you please share the exact code & your package versions, please – harishr Oct 13 '17 at 03:59

1 Answers1

0

You appear to be using the legacy AMQP 1.0 JMS client from the Qpid project which is no longer supported. The first thing I'd suggest is switching to the newer AMQP 1.0 JMS client which you can find on the Qpid site.

Here's a link to the Qpid JMS client examples mirrored on Github, and here's what your maven dep should look like.

<dependency>
  <groupId>org.apache.qpid</groupId>
  <artifactId>qpid-jms-client</artifactId>
  <version>0.23.0</version>
</dependency>
Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • org.apache.qpid qpid-amqp-1-0-client 0.32 – user3841554 May 17 '17 at 14:57
  • Above is the AMQP JMS client version, i think i am using the correct version – user3841554 May 17 '17 at 14:59
  • Nope, you are using the deprecated legacy client, look at the links posed in the answer. – Tim Bish May 17 '17 at 16:28
  • I have dependencies for the artifacts qpid-jms-client and qpid-amqp-1-0-client . I had 0.22.0 version for qpid-jms-client and changed to 0.23.0 as you mentioned. For qpid-amqp-1-0-client i still have 0.32 version. i am getting the same exception when i run my program after changing the qpid-jms-client version to 0.23.0 – user3841554 May 17 '17 at 17:01
  • Which implies you are pulling two different JMS clients into your project and from the output it seems you are using a ConnectionFactory from the 0.32 version which is deprecated. Remove all references to that, one JMS client in your project, adding another won't make it twice as fast or anything – Tim Bish May 17 '17 at 17:04