4finance/micro-infra-spring — pull request #108 by nurkiewicz (2014-11-25 14:50:12+00:00)
Title: Hystrix support

This PR adds small support for Hystrix via `CorrelatedCommand` base class. Use it instead of raw `HystrixCommand` in order to propagate correlation ID through Hystrix command/thread pool.

Second commit uses new `CorrelationIdUpdater.withId()` to make sure we clean up properly after manually assigning correlation ID in few places.

Open question: `CorrelatedCommand` overrides `run()` (with `final`) and requires overridng `doRun()` instead. This is slightly awkward because `HystrixCommand` requires overriding `run()`. Is it OK for you? I'd rather leave `run()` abstract, but don't know where to plug correlation ID logic then.

Second question: do we need any other extra support? I think we agreed that it's not our decision to add Hystrix implicitly somewhere, so I'm just adding a basic building block.