I need to come up new feature i.e. new maven module/services/domain objects. That module has dependency on other modules and call their services. I need to decouple that call from new services to existing services. Decouple here means modules does not know about each other either at compile or run time. For example :- Instead of calling any other service directly ways can be
- Put it on channel. Another service listens on it, process it once find object on channel and return the output on same channel where caller waits for output
- Channel can be any medium like object/queue/network etc
I am sure there should be many ways to decouple the call to existing services. There are two ways I can think of :-
Microservices :- As this is very small feature(will not require scaling in future) using the same Database. So, I am not convinced here
ESB :- Not sure just to decouple the existing service calls , ESB is the good way ?
Does spring provides any way to decouple the services ? Looks like Sprint events comes closure where events are published and listener get notified. But spring listener does not return the output . Anything else in spring can help here ?