warning-explosive / Core

Framework for the core domain development
MIT License
1 stars 0 forks source link

Add rpc client for blocking inter service communication #205

Open warning-explosive opened 1 year ago

warning-explosive commented 1 year ago
  1. Use REST API (HTTP 1/2) for inter-process communication and in-process mock as a shortcut (in-process mock inlines RPC call);
  2. (optional) Forbid inlining for message handlers that calls for RPC result from the same process because it leads to deadlocks;
  3. Handle service discovery issue - target localhost, k8s or docker-compose deployments where are no need in service discovery;
  4. .UseWebApiGateway() call should resolve in-process endpoints by incoming message headers
  5. Common controller should handle incoming request as message handler does with some tweaks (it calls IGenericEndpoint.ExecuteMessageHandler());
  6. ErrorHandlingMiddleware should abandon retries and return errors in RPC style (recode retries);
  7. UnitOfWorkMiddleware shouldn't use inbox/deduplication features so as to handle all incoming requests and because queries don't produce database changes;
  8. UnitOfWorkMiddleware should use outbox, so as to send outgoing messages, excluding reply, we should capture(extract from outbox) reply and return it in RPC style;