0

I have my service layer 'S' calling data layer 'D_OLD'. Now I am upgrading my D_OLD database version to D_NEW. But I want to test stability for a few days and if not stable, I want to rollback. But if I rollback, I must be able to replay all the transactions happened on new database to old database. What I am planning is to have two instances of D, one with new database and other running with old database. I am planning to intercept all the PUT/POST/DELETE requests from S to D_NEW and put it in a kafka topic. I will have a job to replay that requests into D_OLD.

Now my S is a spring application using ribbon for making requests to D_NEW. I have tried ClientHttpRequestInterceptor, but seems it work only with RestTemplate.

Is there any way to intercept outgoing requests in ribbon/spring/tomcat?

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Renjith
  • 3,274
  • 19
  • 39
  • In S, what HTTP client are you using? – Jose Martinez May 09 '18 at 12:01
  • Im using ribbon https://github.com/Netflix/ribbon/ – Renjith May 09 '18 at 12:04
  • 1
    If you are accessing the data layer with some kind of an interface why don't you make an implementation that after doing the changes in D_NEW does the same in D_OLD using the old data access services (in a separate thread or queue to avoid the extra delay) . You will register the new implementation (new beans registered to spring) then use both new and old and after time - remove the old ones. And just having one proxy implementation for the service class – Veselin Davidov May 09 '18 at 12:08
  • @VeselinDavidov I dont want to overload my S with processing data for D_OLD as well. Some POST/PUT requests are very heavy. – Renjith May 09 '18 at 14:46

0 Answers0