I have a problem when try to send a message to a service bus topic through java azure sdk, I receive 500 Internal Server Error.
I prepared code based on this link: https://azure.microsoft.com/en-us/documentation/articles/service-bus-java-how-to-use-topics-subscriptions/ and my code looks like below:
Configuration config = ServiceBusConfiguration.configureWithSASAuthentication(
"NAMESPACE",
"SAS_NAME",
"SAS_KEY_VALUE",
".servicebus.windows.net");
ServiceBusContract service = ServiceBusService.create(config);
try {
BrokeredMessage message = new BrokeredMessage("Message content");
service.sendTopicMessage("TOPIC_NAME", message);
} catch (ServiceException e) {
e.printStackTrace();
}
I'm able to send a message with the same config values with .NET code.
And here is the exception that I receive: "com.sun.jersey.api.client.UniformInterfaceException: POST https://NAMESPACE.servicebus.windows.net/TOPIC_NAME/messages?api-version=2013-07 returned a response status of 500 Internal Server Error"
I have also a question about api-version. Why a library put so old api-version in the request? I use the latest version of azure sdk from maven repository:
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>0.9.3</version>
</dependency>