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?