apache kafka – specific or abstract when issuing a event in MSA?

We have blog service that can update the title of the blog.
And we have search service that allows you to search for blog title.

In this system, when blog title changed, search service should put the blog title to search engine

I am trying to implement this requirement using a message system.

The blog service should issue event when the title is updated. There seem to be two options.

  1. Specific. issue BlogTitleUpdatedEvent with blogId and title
  2. Abstract. BlogUpdatedEvent with blogId

First option is specific, It is clear what event occurred but each time another event is added, we need to create one.

Second option is abstract, so blog service not dependent on other services. because we don’t have to know what other service doing. we just issue blog update event. but other service should be request data for each requirement

When we try to build message system in MSA, which one would be better? I would appreciate it If you could tell me about your experience.

Read more here: Source link