Giter Site home page Giter Site logo

correlation-id-async's Introduction

correlation-id-async

This is a simple Spring boot-based application that demonstrates how request correlationIds could be generated and managed in order to correlate and track an initial request's handling (and journey) through a distributed SOA/microservices application.

This version extends on the work in my other correclation-id-sync repo (which works correctly only with synchronous request handling) by providing a series of wrapper Classes to transparently propogate the correlation Id across differing Threads. Note that the main NewsController.externalNews method returns a DeferredResult<String> instead of a String directly.

Notes

The adapter code between the DeferredResult and Future is currently dependent on Google Guava, but at some point I may re-write this to utilise the new Spring 4.0 ListenableFuture or Java 8 CompletableFuture.

This code also utilses Java 8 syntax, namely a method reference in the NewsController, but this could easily be converted for Java 7 compliance.

This code could do with some tidying-up (e.g. extraction of private ListeningExecutorService service in NewsController) ;-)

Disclaimer

This is just an experiment and toy-example! I'm not suggesting this code is production-ready! :-)

correlation-id-async's People

Contributors

danielbryantuk avatar

Watchers

James Cloos avatar Braian Nunes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.