O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Consumer Driven Contracts and Your Microservice Architecture

17.490 visualizações

Publicada em

My talk from SpringOnePlatform about Spring Cloud Contract

Links:
* http://martinfowler.com/articles/consumerDrivenContracts.html - article about Consumer Driven Contracts by Ian Robinson
* https://github.com/marcingrzejszczak/springone-cdc-client - code for the client side of the presented example
* https://github.com/marcingrzejszczak/springone-cdc-server - code for the server side of the presented example
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html - documentation of the Spring Cloud Contract project

Publicada em: Tecnologia
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ https://www.ThesisScientist.com and Watch latest Blogs On Latest and New Technology @ https://www.ThesisScientist.com/blog
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • i­f y­ou t­h­i­n­k T­h­e­l­m­A`s st­ory ­is ­n­e­At,, t­hr­e­e w­e­e­ks ­A­g­o ­my ­c­ous­i­n­ns st­e­p-­d­A­A­d ­g­ot $7275 just s­itt­i­n­g t­h­er­e ­e­l­ev­e­n ­h­ours ­A w­e­e­k ­fr­o­m t­h­er­e ­A­p­Art­m­e­nt ­A­n­d t­h­ey'r­e ­c­l­Ass­m­At­e's s­ist­er`s ­n­e­i­g­h­b­our ­d­i­d t­h­is ­f­or ­e­i­g­ht ­m­o­nt­hs ­A­n­d ­g­ot ­p­A­i­d ­ov­er $7275 ­p­Art t­i­m­e ­fr­o­m t­h­e­ir ­p­c. ­A­p­p­l­i­e t­h­e st­e­ps ­Av­A­i­l­A­b­l­e ­h­er­e,­...................www.jobsish.com
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • my ­fr­i­e­n­d's ­Au­nt ­m­A­k­es $60 ­h­our­ly ­o­n t­h­e ­l­A­pt­o­p. S­h­e ­h­As ­b­e­e­n ­out ­o­f ­A j­o­b ­f­or 10 ­m­o­nt­hs ­but ­l­Ast ­m­o­nt­h ­h­er ­p­Ay w­As $12603 just w­or­k­i­n­g ­o­n t­h­e ­l­A­pt­o­p ­f­or ­A ­f­ew ­h­ours. ­g­o t­o t­h­is w­e­b s­it­e This is what I do.....copy and paste www.jobsish.com ­A­n­d r­e­A­d ­m­or­e­
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Hello everyone, i am here today on this forum giving a life testimony on how I was cured from HIV Virus while this may sound discouraging and people may not be-live that HIV CURE has be found,while i was once an HIV positive i live with this disease for more than years now, i have been to so many places for help including hospitals wasted money and times hoping that i was going to get cure but nor was able, until God use someone to cure me from this disease (HIV) true the help of a man called Dr osemu with his herbal root herbs medicine. while i don’t have much to say but to give thanks and praise to God almighty who use Sir Dr osemu to extend my life for what you have done for me DR, i will not stop thanking you because you put a smile on my face again.thanks once again if you are into similar problem or with any kind of diseases you can contact Sir Dr osemu on his mail drosemuspellcaster@gmail.com or call him or whatsapp on +2349073889037 and i will not stop thanking you DR osemu for what you have done for me in my life, i will keep posting to the world for them to no that you are in existence , thanks for your audience and i hope you find help like i did for what he has done for me, if you are into similar problem like HERPES,HEPATITIS B,CANCER,DIABETICS.do not wast time to contact him now his WhatsApp +2349073889037 and his email drosemuspellcaster@gmail.com.
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Nice! You can visit me http://amocasapentrutine.ro
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui

Consumer Driven Contracts and Your Microservice Architecture

  1. 1. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Consumer Driven Contracts and Your Microservice Architecture By Marcin Grzejszczak @mgrzejszczak
  2. 2. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ About me • Spring Cloud developer • Working mostly on Spring Cloud Sleuth and Spring Cloud Contract • Automation freak Twitter: @mgrzejszczak Blog: http://toomuchcoding.com
  3. 3. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Agenda • Introduction • Demo • Summary
  4. 4. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Introduction • Producer – service that exposes an API • Consumer – service that consumes the API of the producer • Contract – agreement between producer and consumer how the API will look like • Consumer Driven Contracts – approach where the consumer drives the changes of the API of the producer
  5. 5. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What are we going to code? • Consumer – service that gets beer requests – has to ask another service if the client can get the beer • Producer – service that checks if the client is old enough to buy beer • Feature – if the user is too young - the beer will not be sold – otherwise the beer will be granted
  6. 6. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ DEMO
  7. 7. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Summary With Spring Cloud Contract and Consumer Driven Contracts: • we’ve created an API that suits the consumer and the producer • expectations were defined by readable contracts that were tested against the producer • producer stubs can be reused by consumers • starting and setting stubs is fully automated
  8. 8. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Summary - Consumer flow 1 Consumer • starts TDD - writes the test for the feature • clones producer code to change the API locally • in the cloned producer code converts contracts into stubs and installs them locally • in the consumer code turns Stub Runner to offline mode • configures Stub Runner to download stubs of the producer • red - green - refactor on the API and tests • repeats the process until the tests are green and API acceptable • files a PR to the producer with the contract proposal
  9. 9. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Summary - Producer flow Producer • takes over the PR • writes the missing implementation that will make the autogenerated tests pass • merges PR and deploys the JARs with the app and the stubs
  10. 10. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Summary - Consumer flow 2 Consumer • switches off the Stub Runner’s offline mode once the producer uploads the stubs • configure Stub Runner by providing the URL to a repo with stubs • will have its test broken if the producer makes any breaking changes of the API
  11. 11. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Why use Spring Cloud Contract Verifier? • Possibility to do CDC with messaging • Clear and easy to use, statically typed DSL • Automatic generation of tests from the defined Contract • Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory • Spring Cloud integration - no discovery service is needed for integration tests
  12. 12. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ QUESTIONS?
  13. 13. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ ● http://martinfowler.com/articles/consumerDrivenContracts.html - article about Consumer Driven Contracts by Ian Robinson ● https://github.com/marcingrzejszczak/springone-cdc-client - code for the client side of the presented example ● https://github.com/marcingrzejszczak/springone-cdc-server - code for the server side of the presented example ● https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html - documentation of the Spring Cloud Contract project Thank you!
  14. 14. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Learn More. Stay Connected. https://gitter.im/spring-cloud/spring-cloud-contract @springcentral spring.io/blog @pivotal pivotal.io/blog @pivotalcf http://engineering.pivotal.io

×