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?

  • 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 2 '16 at 8:06
  • @LucFranken when you say new service, you mean I could have one service which is processing all events? – Robert Sep 2 '16 at 8: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: programmers.stackexchange.com/a/277043/46605 – Luc Franken Sep 2 '16 at 8: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 2 '16 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.