3 ms·
Hey, I've been learning Kafka too and posted this on another sibling comment: > So I've been looking into microservices communicating with a persistent message
by spraak 7y ago
Hey, I've been learning Kafka too and posted this on another sibling comment:
> So I've been looking into microservices communicating with a persistent message broker like Kafka and what I'm still not sure about is the frotnend - that is, I know that the FE will communicate over https with an API gateway service (so REST or GraphQL) but if the FE needs a resource, how should the API gateway handle the request back to the browser? The only pattern I've seen so far is to issue a 201 CREATED for e.g. creating a user. Have you come across any other patterns for this?
- dkoston 7y agoMost likely the API Gateway speaks HTTP so it's no different than communicating with any other HTTP API. The API Gateway has a number of roles: routing requests to the right backend(s), checking the health of one or more backends, providing a single point of contact to the outside world (reduces the number of systems you have to lock down related to access from the public), holding api documentation, and others. Think of the API gateway mostly as a router that allows you send requests to many different pieces of software behind it. As far as patterns for HTTP Status Codes, you should take a look at the RFCs that define them: https://tools.ietf.org/html/rfc2616#section-10 https://tools.ietf.org/html/rfc2616#section-10