I have two web separate apps in azure, one to administer content, and the other for displaying this content.
Currently I'm sending http requests from the admin app to the public app to clear in-memory caches of various objects.
This works fine, but won't scale out to more than one instance.
So, I've begun to investigate Service Bus topics for a pub/sub model for communication.
I've had no trouble sending the message to the topic from the admin app, but I can't sort out how to consume these messages from the public app.
There are plenty of examples of doing this inside a worker role or a web job, but I can't find any examples of receiving messages from a web app.
Further, once I sort this out, I will need to handle separate subscriptions for each instance. My idea is to use the WEBSITE_INSTANCE_ID in the subscription. Has anyone done this, or are there better solutions for multiple instances?
Or, is there a better way to handle distributed cache clearing?
System.Runtime.Caching.MemoryCache
for the cache, b) using a WebRole instead of a WebApp, c) running the Service Bus message pump from the WebRole "OnStart" entry point?