I have a java process which needs to communicate with an Azure C# application via storage queues.
When running in Azure Web, the java process is able to read and write messages to storage queues.
However, when I run the java process locally and try to communicate with Azure's emulator, I can read messages from the queue but cannot write to the queue.

Below is the code I use, which hangs on the last line, then times out after several minutes.
Any suggestions will be much appreciated.

CloudStorageAccount acct;
if (configuration.equals(configurationTypeLocal)) {
   acct = CloudStorageAccount.parse(localStorageConnectionString);
} else {
   acct = CloudStorageAccount.parse(cloudStorageConnectionString);
}
CloudQueueClient client = acct.createCloudQueueClient();
_queue = client.getQueueReference(queueName);
_queue.createIfNotExist();
_queue.addMessage(new CloudQueueMessage(txt));
有帮助吗?

解决方案

When developing with the emulator it is important to ensure the version of the Emulator is appropriate for the version of the client libraries you are using. If you are using an old version of the emulator with a more recent version of the client libraries you can end up with problems where the functionality you are requesting of the service has not been implemented in the emulator.

Given that you said the functionality works when you use the online service, but not when you use the emulator I am guessing this is the problem. Download the latest version of the emulator and you should be fine.

Jason

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top