none
WCF contract changes and MSMQ

    Pregunta

  • Does anyone know how this would work:

    we have a MSMQ queue. There is a WCF contract, lets say, IPerson with these properties:

    string Name {get;set;}

    int Age {get;set;}

    This works fine.

    But say in future, I decide to add another property (or method) - what will happen to the existing "contract" compliant messages being sent to the queue?

    Is there a way for the WCF contract to continue processing older style messages but also new ones at the same time?


    C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator

    viernes, 04 de mayo de 2012 22:32
    Moderador

Todas las respuestas

  • Your contract or what ever messages written in the msmq as an XML object. If you add more property it will convert those to xml as well and write it to MSMQ. 

    Now, it depends on the process that picks up the messages and convert it to appropriate objects and do the processing. 

    So if you change the contract and dont update the service that picks up the messages from queue and do the processing it will fail. If you update the service with the same contract dll, it will still work fine, even though you dont necessarily have to use the new property in processing

    Hope that make sense  


    Tanvir Huda Application Architect/Consultant http://thetechnocrate.wordpress.com/

    lunes, 07 de mayo de 2012 2:07
  • thanks. but how would you then make sure that the service still continues to work when you have updated the service but still be able to process old style messages/contracts?

    C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator

    lunes, 07 de mayo de 2012 8:34
    Moderador
  • unit test

    Tanvir Huda Application Architect/Consultant http://thetechnocrate.wordpress.com/

    martes, 08 de mayo de 2012 1:20
  • sorry but that is not the real answer im looking for.

    im not talking about development lifecycle process like TDD or agile but more about in the real world scenario.

    please explain how you can make sure that any new versions of contracts can continue or allow old versions of contracts to still function with MSMQ and WCF


    C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator

    martes, 08 de mayo de 2012 1:23
    Moderador
  • Unit test is part of TDD or agile development but also part of real world application development. Real world app development doesnt mean write something and put straight away into production. What i mean you need multiple test cases to meet your all situation and make sure it PASSes every situation.

    Have a look at this link 

    http://msdn.microsoft.com/en-us/library/ms731138.aspx

     

    Tanvir Huda Application Architect/Consultant http://thetechnocrate.wordpress.com/

    martes, 08 de mayo de 2012 2:44
  • yes im aware of this.

    ok, im not looking for anything relating to development processes. I do not think you understood the question.


    C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator

    martes, 08 de mayo de 2012 2:52
    Moderador