Search code examples
javaservicebus

Service Bus for Windows Java?


We are evaluating Service Bus for Windows Server 1.0 for use as an on-site Service Bus and are really liking how easy it is to install, configure, manage, etc, and developing .NET applications that take advantage of it are also quite easy.

Part of the company uses Java though and we would like to be able to leverage any Service Bus implementation from both code bases. Since there is a lot of feature parity between Service Bus for Windows and the Azure Service Bus, can we use the Azure SDK for Java to interact with our local service bus?

I have found several code samples for the Java SDK, but they are all geared towards the Azure bus, so I'm not quite sure what values to provide when attempting to connect.

For instance, everything revolves around creating a ServiceBusContract instance, which takes a Configuration instance created by the ServiceBusConfiguration.configureWithWrapAuthentication or ServiceBusConfiguration.configureWithConnectionString methods.

In the case of the .condifureWithWrapAuthentication method, what should I be passing in for the serviceBusRootUri (examples say to use '.servicebus.Windows.net'; this obviously won't work locally) and wrapRootUri (examples say to use '-sb.accesscontrol.windows.net/WRAPv0.9'; again, this won't work locally) parameters? I did stumble across this post that says the JavaDocs give more information that you think, including local configuration, but I've read it top to bottom about 6 times and don't see anything local about it.

Does anyone know of or have a sample that shows how to access a local Service Bus using Java and the v0.4.2 SDK?


Solution

  • You can grab a connection string for the namespaces for server (using this command in Service Bus Powershell). That should show you the serviceBusRootUri for your namespaces.

    Edit: Server does not support ACS -- it only supports SaS and Windows Authentication. I don't believe the Java SDK supports those natively, so I don't believe it would fit your need.