0

Dears,

we build two microservices the first is a notification microservice that is responsible for sending and handling notifications like SMS, Email, and App notification ...etc and the second is a service catalog to define the information and configuration of services like service name, description, activation status active or not and ...etc.

My question is if I have configuration about service like allowed notification types that can be used by the service for example service A can send only SMS, and Serivice B Can send Email & SMS.

what is the proper service to define this configuration?

set this configuration as metadata in the service catalog or set in the notification as configuration

  • It is up to you really, to what level of abstraction a `service` in your architecture goes. If your Notification service is responsible for all `channels` of sending messages, then metadata can reside along with it. But if you build more granular service like SmsService, EmailService etc., then each of that is an independent service that you can keep in the service `catalog`. – Anand Sowmithiran Dec 25 '22 at 13:20

1 Answers1

1

I suppose that it is better to put information about of service in current service, not as separate service.

For instance, service A would have method api\info

GET a/api/info 

And the above api would return the following info: can send only SMS

Another example would be service B that would have method api\info

GET b/api/info 

And the above api would return the following info: send Email & SMS

As an analogy, you can consider a website "animals.com" that have an area "About us". It would be not really convenient to have "About us" of "animals" at, e.g. "vegetables.com"

what is the proper service to define this configuration?

I would try to apply Single Responsibilty Principle of SOLID rules here and place setting configuration at service where we want to change configuration. E.g. we have a service A. So A service is proper service to set its configuration

StepUp
  • 36,391
  • 15
  • 88
  • 148