Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Using on-premises ServiceBus 1.1 from java

$
0
0

I have installed the Windows Azure SDK for Java  0.5.0 and an on-premises ServiceBus 1.1.

Using AMQP and JMS via qpid I can send and recieve messages fine.

Using the c# and .Net example 

Service Bus HTTP Token Providers

I have also created and used Queues.

Following the examples Java and ServiceBus  I have created a java client to browse the Queues;

public static void main(String[] args) {
		System.setProperty("javax.net.ssl.trustStore","C:/Program Files/Java/jdk1.7.0_51/jre/lib/security/cacerts");

		Configuration config = ServiceBusConfiguration
				.configureWithConnectionString(
						"",
						Configuration.getInstance(),"Endpoint=sb://myfqdn/ServiceBusDefaultNamespace;StsEndpoint=https://myfqdn:9355/ServiceBusDefaultNamespace;RuntimePort=9354;ManagementPort=9355;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=whatever");

		ServiceBusContract service = ServiceBusService.create(config);

		try {
			for (QueueInfo queue : service.listQueues().getItems()) {
				System.out.println("q: " + queue);
			}
		} catch (ServiceException e) {
			System.out.print("ServiceException encountered: ");
			System.out.println(e.getMessage());
			System.exit(-1);
		}


However when I run this I get a problem;

Exception in thread "main" java.lang.RuntimeException: The key 'RuntimePort' is not valid for this connection string
	at com.microsoft.windowsazure.services.servicebus.implementation.Exports$1.create(Exports.java:51)
	at com.microsoft.windowsazure.services.servicebus.implementation.Exports$1.create(Exports.java:32)
	at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
	at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
	at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
	at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
	at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
	at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
	at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
	at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
	at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
	at com.microsoft.windowsazure.Configuration.create(Configuration.java:113)
	at com.microsoft.windowsazure.services.servicebus.ServiceBusService.create(ServiceBusService.java:48)
	at uk.co.his.test.azure.TestSbus.main(TestSbus.java:66)
Caused by: com.microsoft.windowsazure.core.utils.ConnectionStringSyntaxException: The key 'RuntimePort' is not valid for this connection string
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.saveValue(ParsedConnectionString.java:311)
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.matchKeyValuePair(ParsedConnectionString.java:144)
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.matchAttribute(ParsedConnectionString.java:112)
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.matchConnectionString(ParsedConnectionString.java:93)
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.<init>(ParsedConnectionString.java:40)
	at com.microsoft.windowsazure.services.servicebus.implementation.ServiceBusConnectionString.<init>(ServiceBusConnectionString.java:38)
	at com.microsoft.windowsazure.services.servicebus.implementation.ServiceBusConnectionSettings.parseConnectionString(ServiceBusConnectionSettings.java:67)
	at com.microsoft.windowsazure.services.servicebus.implementation.ServiceBusConnectionSettings.<init>(ServiceBusConnectionSettings.java:40)
	at com.microsoft.windowsazure.services.servicebus.implementation.Exports$1.create(Exports.java:39)
	... 13 more
Caused by: java.lang.NoSuchMethodException
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.findSetter(ParsedConnectionString.java:331)
	at com.microsoft.windowsazure.core.utils.ParsedConnectionString.saveValue(ParsedConnectionString.java:308)


If I remove the 'offending params' I merely get an error;

<Error><Code>404</Code><Detail>No
service is hosted at the specified
address..TrackingId:a710c56b-892c-4dc4-b990-5b661d0debfd_Gmu,TimeStamp:23/07/2014
11:38:53</Detail></Error>


and the client is sending this to..

https://fqdn:9355/ServiceBusDefaultNamespace/WRAPv0.9

Is it simply the case that the Azure Java SDK is only set up to work with Azure  ServiceBus and not the on-premises version (ServiceBus 1.1)?

Are there any plans to support this? 

Does anyone know of any 'add ins' that will enable me to connect to on-premises, such as SASWrapper which I could not get working with 0.5.0 have ported it?

Are there any official Java REST API examples for ServiceBus?

Thanks




Viewing all articles
Browse latest Browse all 1916

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>