I'm working on a project using springboot, spring cloud netflix, etc., to build microservices.
And for some of the async communication, I'm using Spring Cloud Stream to produce and consume events. e.g. After a business contract is drafted in the contract-service, the service publish a contract-created-event, which will be consume by auditing-service, to init a auditing process. And also, user-service will consume the event to create notifications for related parties.
The scenario is I have many events, consumer will subscribe the interested events based on event types. The problem I have is, I have many event-types, soon, my configuration file is flooded with the channel configurations. e.g.
spring.cloud.stream.bindings.creation.destination=contract-creation
spring.cloud.stream.bindings.revocation.destination=contract-revocation
spring.cloud.stream.bindings.termination.destination=contract-termination
...
I'm doing something wrong? I'm considering those alternatives:
- David Turanski! has a example which will selectively consume the event by type. Which is a good solution, but I'm thinking, Is Spring Cloud Stream have the native solution?
- Should I use Apache Camel or Spring Integration? I don't have complicated routing rules, these frameworks seem like an overkill.
I'm quite a newbie in messaging, hoping folks here could point me to a right direction.