1
votes

I've been trying to make a client to connect my Azure service bus queue. I've been referring to this documentation:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-java-how-to-use-queues#send-messages-to-a-queue.

My code :

public void run() throws Exception {

    try {
        final String ConnectionString = "<My connection String> ";
        final String QueueName = "queue1";
        QueueClient sendClient = new QueueClient(new 
        ConnectionStringBuilder(ConnectionString, QueueName), 
        ReceiveMode.PEEKLOCK); 
        System.out.println("sendClient created");
        sendClient.close();
    } catch(Exception e) {
        System.err.println(e);
    }
}

While making a client i'm getting the following error :

com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=amqp:connection:framing-error, description='org.apache.qpid.proton.engine.TransportException: connection aborted', info=null}

2
I’ve just edited your question, improving either its formatting, or its quality to help people understanding your question, and to help you to get an appropriate answer. - Bsquare ℬℬ
Thanks @Dave. I really appreciate your effort . - Proneet Nibedit
i'm no java expert, but it seems the issue is related to closing the connection while the service bus client is trying to receive messages out of the queue. You can just try to close the connection once you're done from receiving messages - Amjad Husseini

2 Answers

0
votes

I think your connection is not opened. Can you please try queueClient.open() and also check the version of the SDK , update it to new version and please refer this link : https://github.com/Azure/azure-service-bus-java/issues/329

According to the above link, it would be because of some network restrictions. Try to connect is from your own network and check if it works...

0
votes

Are you behind a corporate proxy ? Then you need to switch to HTTP connection (AMQP Web socket) instead of AMQP connection.