none
WCF & MSMQ - is there a better way RRS feed

  • Question

  • I havent worked with MSMQ and have some experience with WCF.  Someone suggested using the 2 of these and I am wondering if this is old school and is there a new and better way. 


    Thanks!

    Thursday, August 8, 2013 9:58 PM

Answers

  • Yes, there are other ways with advantages and disadvantages so it is difficult to say without more context.  If you are looking at a simple way of persistent queuing then I really like MSMQ using WCF.  The price is right and once you have it working it should be stable.  MSMQ can be single server or multiserver so it depends on how you are going to process the requests. 

    If you do not have existing infrastructure then Azure Queues or Azure Service Bus would be worth considering.  You can have a fairly good size solution without encurring cost.

    Unfortunately, the answer is depends on the problem being solved and existing capability.  But, don't discount WCF and MSMQ because it is very powerful, relatively simple to implement, low cost and reliable.


    Jeff

    Friday, August 9, 2013 2:03 AM
  • Hi,

    As @chilberto said, everything has two sides, it just depends on your requirement.

    MSMQ is a service that enables the use of messages queuse (pushing and popping messages using a queue).

    Prior to WCF, you had to use .NET's system.messaging assembly to communicate with MSMQ.

    WCF includes an MSMQ binding, that allows pushing and popping messages from the queue, using WCF's API:

      Sending a messages to the service - pushes the messages to the queue.

      Receiving a message in the service - pulling messages from the queue.

    WCF also includes the MSMQ Integration binding that supports using existing queues that do not use soap messages through WCF client/service.

    Here is the information about using WCF with MSMQ integrated binding:

    #How to: Exchange Messages with WCF Endpoints and Message Queuing Applications
    http://msdn.microsoft.com/en-us/library/ms789008.aspx

    #Windows Communication Foundation to Message Queuing
    http://msdn.microsoft.com/en-us/library/ms751499.aspx

    and for accessing MSMQ with standard .NET Framework API, here are some web articles:

    #Accessing Message Queues
    http://msdn.microsoft.com/en-us/library/ms978425.aspx#bdadotnetasync1_topic4

    #Programming MSMQ in .NET - Part 1
    http://www.codeproject.com/Articles/3944/Programming-MSMQ-in-NET-Part-1

    #How to write to and read from Microsoft Message Queuing in Visual C#
    http://support.microsoft.com/kb/815811
     
    You can take a look at them to see if that meets the requirement.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Monday, August 12, 2013 4:10 AM
    Moderator

All replies

  • Yes, there are other ways with advantages and disadvantages so it is difficult to say without more context.  If you are looking at a simple way of persistent queuing then I really like MSMQ using WCF.  The price is right and once you have it working it should be stable.  MSMQ can be single server or multiserver so it depends on how you are going to process the requests. 

    If you do not have existing infrastructure then Azure Queues or Azure Service Bus would be worth considering.  You can have a fairly good size solution without encurring cost.

    Unfortunately, the answer is depends on the problem being solved and existing capability.  But, don't discount WCF and MSMQ because it is very powerful, relatively simple to implement, low cost and reliable.


    Jeff

    Friday, August 9, 2013 2:03 AM
  • Hi,

    As @chilberto said, everything has two sides, it just depends on your requirement.

    MSMQ is a service that enables the use of messages queuse (pushing and popping messages using a queue).

    Prior to WCF, you had to use .NET's system.messaging assembly to communicate with MSMQ.

    WCF includes an MSMQ binding, that allows pushing and popping messages from the queue, using WCF's API:

      Sending a messages to the service - pushes the messages to the queue.

      Receiving a message in the service - pulling messages from the queue.

    WCF also includes the MSMQ Integration binding that supports using existing queues that do not use soap messages through WCF client/service.

    Here is the information about using WCF with MSMQ integrated binding:

    #How to: Exchange Messages with WCF Endpoints and Message Queuing Applications
    http://msdn.microsoft.com/en-us/library/ms789008.aspx

    #Windows Communication Foundation to Message Queuing
    http://msdn.microsoft.com/en-us/library/ms751499.aspx

    and for accessing MSMQ with standard .NET Framework API, here are some web articles:

    #Accessing Message Queues
    http://msdn.microsoft.com/en-us/library/ms978425.aspx#bdadotnetasync1_topic4

    #Programming MSMQ in .NET - Part 1
    http://www.codeproject.com/Articles/3944/Programming-MSMQ-in-NET-Part-1

    #How to write to and read from Microsoft Message Queuing in Visual C#
    http://support.microsoft.com/kb/815811
     
    You can take a look at them to see if that meets the requirement.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Monday, August 12, 2013 4:10 AM
    Moderator