0

I am developing a generic logging object which will be used within all of our future applications. It will submit a log to MSMQ, which will then asynchronously send it off to our server that will log that message to a database.

Currently I am trying to understand the architecture of how this will work. On the client side, once a log is submitted to MSMQ, will MSMQ then submit the log to WCF to send off to the server (which I assume will have another WCF endpoint receiving the messages)? Basically, I am asking what is the order of services that the log will travel through? I have read about netMsmqBinding for WCF, is this what I will need in order to send a log from MSMQ to WCF, and then I can use a basicHttpBinding to send it from WCF to WCF on the server side?

Something like:

[Client application] -> Logger -> MSMQ -> WCF ----------> [Server] WCF -> DB

jnevelson
  • 2,092
  • 2
  • 21
  • 31

1 Answers1

2

WCF has netMsmqBinding that can handle both client and server messaging. If you use it MSMQ will be almost invisible to you. You will send message to WCF service, it will be put to MSMQ and server-side WCF will pick it and invoke method like with any other binding.

If you have any experience in creating WCF service you should do the same but also create MSMQ Queue.

Here are useful links: http://sukasom.wordpress.com/2008/08/18/wcf-and-msmq-part-1/, http://msdn.microsoft.com/en-us/library/ms752217.aspx

Andrey
  • 59,039
  • 12
  • 119
  • 163
  • Do I set up the netMsmqBinding endpoint on the client side or the server side? The way I am seeing it right now is that I don't need MSMQ at all on the server side. Or am I way off? How will the client know the server received the message so that the message can be removed from MSMQ on the client? – jnevelson Mar 23 '11 at 16:40
  • @jonathan MSMQ Service is standalone service. Physically it can be run anywhere, on same PC as server, client or on separate one. It has to have persistent address or hostname, that's it. MSMQ is one-way communication, you can't check that message was delivered from client. Actually MSMQ is safe messaging, infrastructure controls delivery. – Andrey Mar 23 '11 at 16:43
  • Got it working, thanks for the links (especially the first one). The netMsmqBinding really does take care of everything, no need to even touch MSMQ in the code. – jnevelson Mar 23 '11 at 18:25
  • My question then is how does this work? The client computer I am testing from does not even have MSMQ installed, and yet I am able to queue messages when the server isn't running, and the messages then get received when I start the service. – jnevelson Mar 23 '11 at 18:28