I'm developing a cloud application, that indexing a large number of documents (with lucene), and hosting a wcf service to search it.
I have 3 roles:

I web role, which is hosting the WCF service, and keep a copy of the index in memory.

I web role for administration (update the index).

A worker role, which is polling a service bus, for update message.

The process of the update:

Sing in to the Admin website, and push a button..The admin webrole put an update message to the queue, and the worker role receives this message, iterate through over the document sources (they are online too) and starts the update.

I would like to update the index once or twice a week, so the worker role pools the message queue a lot of time with no result (even if I set a big sleep time in thread.sleep), and we have to pay for every transaction.

What you think? Would it be better to host a WCF servcice inside the worker role to receive the update message, and not polling the message queue (mostly) unnecessarily?

2 Answers
2

It depends on your future plans for that application.
WCF is definitely a good way to set up inter-role communication, especially for these 'low-frequency' events.
But if you plan to have more and more of these admin events (and maybe even plan to schedule some of these events , using the delivery scheduling options for service bus messages), than service bus might offer you just that little thing more. If you don't need the async, scheduling and scale out, than just go for WCF
Good luck with the app

Unless you have some very specific needs for Service Bus messaging, this sounds like overkill, especially with the very low message frequency you're sending. A very simple WCF service call should suffice. And if the WCF service is kept internal-only (meaning access over an internal endpoint without exposing it to the world), then you don't even need to worry about security.