0

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

  1. 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
  2. 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 ?

user3198603
  • 5,528
  • 13
  • 65
  • 125

1 Answers1

0

Are you asking about removing the classpath dependency, or if you should choose ESB, micro-services. The latter sounds like something which is more of a discussion you should have in your business than a SO question.

If you simply want to remove maven dependency hell maven creates, what you could do is create a project which has interfaces defining your old services. Your new services would work with these interfaces as opposed to depending on your old services directly. Of course however you will have to have some overarching project which as everything in it's classpath or you need to use OSI container or something of the likes. But you will be able to keep developing your new services as you wish without them knowing about your old services.

In regards to the type of architecture you want to use that is highly debatable and opinionated with no clear cut answer. But I will say that I don't think avoiding large classpaths is a great reason for implementing microservices or ESBs, but that's just my opinion. If that is your only real reason you want to go down that path I suggest don't.

Derrops
  • 7,651
  • 5
  • 30
  • 60