0

We have several systems that we're going to switch to use some type of reliable architecture and using messaging is how we want to do it.

The thought is that we're going to use some cheap hosting (shared, not dedicated) to make calls but we need the calls to be reliable. If the destination server is not available, the message must be retried a few times before failing.

Web page is accessed > site adds a request to the queue > message is delivered to target end point

Is this do-able with shared hosting? What are other options if WCF + MSMQ wont work?

Dustin Davis
  • 14,482
  • 13
  • 63
  • 119

2 Answers2

1

If you are able to use Server 2008 to for a WCF service with a netMsmqBinding endpoint to call the shared host then you can take advantage of the MSMQ 4 enhanced failed message handling features. With little extra coding, the WCF netMsmqBinding can be configure to automatically retry failed message and also remove a failed message from the queue to a special poison queue so the service can continue processing messages. You can manually move messages from the poison queue back to the main for re-processing once the share host is accessible again or write another service to handle this task automatically. This article on MSDN should is a good start for setting an MSMQ based WCF service and this article shows how the poison message handling works.

Sixto Saez
  • 12,610
  • 5
  • 43
  • 51
  • My question is, if I have a WCF service on my server using net.msmq binding and I need to call it from a web page on a shared hosted server in an async manner, will the message retry/deliver on it's own? – Dustin Davis Apr 15 '11 at 03:16
  • MSMQ queues can be accessed using HTTP over the Internet but I don't know if it's supported by WCF. You may want to look at RabbitMQ, an open source message queuing framework. There is a WCF binding that uses it which may be supported from a client running on that shared host server. – Sixto Saez Apr 15 '11 at 04:29
  • I found the link below to RabbitMQ and its documentation. It has a pretty good description on how to configure their WCF binding. Haven't dug into it too much but it would seem to provide what you need without depending on enabling the Windows MSMQ plumbing at the shared host. The transport for RabbitMQ is TCP. The shared host would need to allow two-way calls to your service IP address and port and you would need to open that port on your company firewall. Link: http://www.rabbitmq.com/dotnet.html – Sixto Saez Apr 15 '11 at 12:46
0

In a shared hosted environment it's up to the host if they will allow you to use MSMQ (or even rabbitQ which you wont be able to install yourself).

WCF over MSMQ works by WCF writing a message to a queue then MSMQ handles delivery of the message to the target and then it activates WCF with the message just as if you're calling it via SOAP.

Bottom line is: You will need to check if your host will allow message queues. If they do, make sure you add security to them so other sites on the server can't access them.

If MSMQ isn't installed on the server then you can't use net MsmqBinding

Dustin Davis
  • 14,482
  • 13
  • 63
  • 119