I'm building a simple Azure Worker Role to Subscribe to a zeromq Publisher (using NetMQ in the worker) and store messages into Azure Tables.
Everything works fine when I run the worker on my dev machine. Messages come in and are written to the table.
However, when I deploy the worker to Azure something stops working. I can attach to the worker and see that it is stuck on the blocking subscriberSocket.Receive() call. From the point of view of the worker, no messages ever turn up at the subscribing socket.
I've RDP'd on to the worker and using netstat I can see the outgoing connection from the subscribing socket to the remote publisher is established, so it doesn't look like a firewall issue.
From the logs / diagnostic info everything seems to be normal, it's just that no messages are ever received.
Is there some Azure configuration I've missed? Something that would allow outgoing connections but prevent data getting through?
Relevant part of the worker code:
private async Task RunAsync(CancellationToken cancellationToken)
{
Trace.TraceInformation("Running Task.");
using (var eDDNcontext = NetMQContext.Create())
using (var subscriberSocket = eDDNcontext.CreateSubscriberSocket())
{
Trace.TraceInformation("Subscribing to EDDN.");
var endpoint = GetEndpoint("EDDNEndpoint");
subscriberSocket.Connect("tcp://eddn-relay.elite-markets.net:9500");
subscriberSocket.Subscribe(String.Empty);
while (!cancellationToken.IsCancellationRequested)
{
Byte[] rawMessage = subscriberSocket.Receive(); //Azure deployment gets stuck on this blocking call.
if (rawMessage.Length < 3) continue;
using (MemoryStream memoryStream = new MemoryStream(rawMessage))
{
//Read past the first two bytes of the zlib header.
memoryStream.Seek(2, SeekOrigin.Begin);
using (DeflateStream deflateStream = new DeflateStream(memoryStream, CompressionMode.Decompress))
using (StreamReader reader = new StreamReader(deflateStream, Encoding.UTF8))
{