CSLA framework and MSMQ.

CSLA framework and MSMQ.

Old forum URL: forums.lhotka.net/forums/t/154.aspx


probashi posted on Friday, May 19, 2006

Is there any MSMQ Host/Proxy for Data Portal?

RockfordLhotka replied on Saturday, May 20, 2006

No, but using the information in chapters 4 and 12 you should be able to create one easily enough.

Well, "easy" is relative... Smile [:)]  The data portal is a synchronous technology, designed for use in an n-tier client/server setting. MSMQ is, by default, asychronous. To create a working data portal channel with MSMQ you'll need to write code in the client-side proxy to simulate sychronous behavior - blocking the client's call until you get a reply message from the server.

(Also, don't forget that if the proxy uses an eventing model to determine when the reply message has arrived in the client's queue that the event may be raised on a background thread. It is your responsibility, as author of the proxy, to get that call back onto the caller's thread. The easiest solution is probably to have the caller's thread send the outbound message, set up the event handler and then block. When the event handler gets called due to the server's message arriving, it should not read the message, but rather should just unblock the caller's thread, and it can do a synchronous read from the queue.)

For an example of an external proxy/host project, you can look at the code in my WcfChannel for the data portal.

Creating an MSMQ channel be well worth doing, because MSMQ offers some nice value in terms of fault tolerance and scalabilty that is comparatively difficult to achieve with Remoting, Enterprise Services or Web Services.

Copyright (c) Marimer LLC