I wrote a test program based on below example to connect to service bus(1.1) installed on windows server using amqp 1.0 java api.
https://msdn.microsoft.com/en-us/library/dn574799.aspx?f=255&MSPPError=-2147217396
Everything is fine till session creation. I am getting "Peer did not create remote endpoint for link, target" exception when I tried to create MessageProducer. I used different versions of qpid-amqp-1-0(0.20 to 0.32) but the error is same.
I put some debug statements in source code of qpid-amqp and I observed SendingLinkEndPoint Target became null after few secs.
End point target: Target{address=testnamespace/testqueue}
End point target: Target{address=testnamespace/testqueue}
End point target: Target{address=testnamespace/testqueue}
End point target: Target{address=testnamespace/testqueue}
Attach{name=testnamespace/testqueue}
End point target: null
javax.jms.JMSException: Peer did not create remote endpoint for link, target: testnamespace/testqueue
RECV: com.microsoft:timeout\xa1\xbcThe operation did not complete within the allocated time 00:00:15.0675072 for object connection
I made sure the user got domain suffix as per below post
Connecting to Service Bus on Windows Server (1.1) using Java and AMQP 1.0
I enabled qpid jms debug in log4j.properties but I dont see any debug statements displayed on the console. Not sure what else I need to do to see what other user oberved(in above post).
log4j.rootLogger=TRACE, stdout
log4j.logger.org.apache.qpid.jms=DEBUG
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p%-30.30c{1} - %m%n
the test code looks like below
String connectionString = "amqps://" + encode(userName) + ":" + encode(password) + "@" + fqdn;
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory");
env.put(Context.PROVIDER_URL, "blah.txt");
env.put("connectionfactory.ServiceBusConnectionFactory", connectionString);
Context context = null;
ConnectionFactory connectionFactory = null;
Connection connection = connectionFactory.createConnection();
System.setProperty("javax.net.ssl.trustStore","C:\\Program Files (x86)\\Java\\jre1.8.0_111\\lib\\security\\cacerts");
System.setProperty("javax.net.ssl.trustStorePassword",pwd);
Session session = null;
MessageProducer producer = null;
try
{
System.out.println("Creating session\n");
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
System.out.println("Creating Queue Impl\n");
QueueImpl queueImpl = QueueImpl.createQueue("testnamespace/testqueue");
System.out.println("Creating producer\n");
producer = session.createProducer(queueImpl);
}
catch (Exception e)`enter code here`
{
System.out.println("Exception creating session/producer\n");
return;
}
All the required ports are opened and enabled debug/trace at windows service level in event viewer but I am unable to identify whats the problem.
Any help would be greatly appreciated.
Thank you, S.