none
How to expose MSMQ over REST services RRS feed

  • Question

  • Hi Guys,

    Here is my scenario, right now i have 2 services in my push notification application, 1st service is exposed to clients as REST and then 2nd service pushes notification to mobile devices, services are running good and working in PROD, now when the network is down i dont have the backup mechanism planned, so thinking of MSMQ in both the services end.

    1st service will have MSMQ and 2nd service also have MSMQ for backup.

    1. My question here is, can i expose MSMQ directly to clients as REST services ?

    2. Do i really need 2 MSMQ ?

    Please share your experience..



    Software Engineer

    Monday, March 25, 2013 5:50 AM

Answers

  • Hi Maria

    1. You can't do this with WCF as the only transport you can use with REST is HTTP. 

    2. If you have an msmq in the 2nd. service - then the first service will write messages to an outgoing queue if the 2nd service, network or server is down. When this comes back up the messages will arrive at the 2nd services. So you probably don't need it. 

    Br,

    JAXN


    Please mark posts as answers/helpful if it answers your question/or helped you solve your problem.
    MCTS: .NET Framework 4, Service Communication Applications


    Monday, March 25, 2013 6:29 AM
  • Hi Maria,


    As JAXN has mentioned, you cannot directly expose MSMQ via REST service endpoint. WCF only supports exposing MSMQ through its built-in MSMQ enabled bindings (like netMsmq or msmqIntegrated binding...). For your case, even if you expose MSMQ via those WCF msmq enabled binding, the client need to be MSMQ ready (not REST client). Maybe you can consider a custom server-side cache/queuing mechanism which persist all the notification requests during the network downtime and send them again whenever network is up.

     

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 1, 2013 5:48 AM
    Moderator

All replies

  • Hi Maria

    1. You can't do this with WCF as the only transport you can use with REST is HTTP. 

    2. If you have an msmq in the 2nd. service - then the first service will write messages to an outgoing queue if the 2nd service, network or server is down. When this comes back up the messages will arrive at the 2nd services. So you probably don't need it. 

    Br,

    JAXN


    Please mark posts as answers/helpful if it answers your question/or helped you solve your problem.
    MCTS: .NET Framework 4, Service Communication Applications


    Monday, March 25, 2013 6:29 AM
  • Hi Maria,


    As JAXN has mentioned, you cannot directly expose MSMQ via REST service endpoint. WCF only supports exposing MSMQ through its built-in MSMQ enabled bindings (like netMsmq or msmqIntegrated binding...). For your case, even if you expose MSMQ via those WCF msmq enabled binding, the client need to be MSMQ ready (not REST client). Maybe you can consider a custom server-side cache/queuing mechanism which persist all the notification requests during the network downtime and send them again whenever network is up.

     

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 1, 2013 5:48 AM
    Moderator