1

Let's say I have 2 micro-services. One is identity and another is support.

I understand when user is created inside identity ms, event will be published and support micro-service will subscribe to that event and copy portion of data which is needed for support context.

Now let's assume the opposite scenario. We are creating a ticket inside support micro-service with a requester which does not exist inside identity micro-service. In this particular case, we want to create identity for that user.

If we contact identity microservice directly from the suppport microservice (HTTP Request), that would be coupling.

Is it good approach if supporting micro-service creates an event "user_creation_requested" , so identity micro-service can subscribe and create user with published details?

Robert
  • 545
  • 6
  • 16
  • 1
    Yes, might be even better to have something like: ticket_created and then a new service called create_ticket_users takes on that event. It will verify and handle the account creation by calling identity when needed. – Luc Franken Sep 02 '16 at 08:06
  • @LucFranken when you say new service, you mean I could have one service which is processing all events? – Robert Sep 02 '16 at 08:07
  • No, but this use case: automated user generation might be worth s separate server. I can see more attached to it in future like: send the new user an email to create an account for example. You could organise that in the new service as it is different from your normal service behavior. See this simple example of an additional third service: http://programmers.stackexchange.com/a/277043/46605 – Luc Franken Sep 02 '16 at 08:18
  • @LucFranken i understand. It's something it would often be used, and It's much better to have it centralized, than make identity service to subscribe to 500 events. – Robert Sep 02 '16 at 09:04

0 Answers0