Design:Microservices Architecture with WebSocket APIs

Anjali Sharma answered on February 2, 2023 Popularity 5/10 Helpfulness 1/10

Contents


More Related Answers

  • socketio connect websockets
  • What is API Gateway Pattern in Microservices?
  • websocket simple server
  • socketio connect websockets
  • socket io websocket connection
  • how to write web service for API in c#
  • In what kind of application we should use microservices?
  • APIS AND MICROSERVICES
  • js websocket connection setup
  • What is the role of Web, RESTful APIs in Microservices?
  • Design: Microservices Architecture with gRPC APIs
  • WebSocket API Real-time two-way communications
  • Designing HTTP based RESTful APIs for Microservice2
  • RESTful API design for E-Commerce Microservices
  • Evaluate: Microservice Architecture with RESTful APIs
  • Designing Sync APIs for Microservices
  • Evaluate:Microservice Architecture with WebSocket APIs
  • What are some advantages of using HTTP and WebSocket for push and real-time communication in microservices ?
  • microservice communication using webclient
  • What are the different ways to make a REST API call in Microservices?
  • Microservices Communication using RestTemplate, WebClient and Cloud OpenFeign
  • RESTful Microservices Pattern
  • Build and run RESTful Microservices
  • Create configuration class with websocket client
  • what is a websocket
  • api testing app with websocket
  • Microservices Communications – API Gateways

  • Design:Microservices Architecture with WebSocket APIs

    0

    Websockets

    A websocket connection opened by a client must eventually connect to a websocket server.

    API Gateway

    The job of the API gateway is to accept an incoming websocket connection from a client and correctly route it to a websocket server. An API gateway will redirect ALL data sent from a client websocket to the correct back-end service and will maintain the connection the entire time.

    How everything works together...

    The root of your question is "how can I have a client with a websocket connection receive a live update from the notification service?". The simplest answer would be to start a websocket server on the Notification Service, let each client connect to the API gateway, then have the API gateway route that traffic to the Notification Service.

    Client <=> API Gateway <=> Notification Service

    Taking it further...

    If you have further requirements by the clients to transform the data coming out of the Notification Service, then you could:

    Stuff that business logic into the Notification Service (not recommended).

    Or, add another service with the transformation logic between the API gateway and the Notification Service which is called the Backends for Frontends microservice design pattern (recommended):

    Client <=> API Gateway <=> Notification Server (transformation logic) <=> Notification Service.

    Or, if your API gateway of choice is designed to hold business logic and transform data; put the transformation logic directly in the API gateway.

    https://stackoverflow.com/questions/47544877/websockets-in-microservices-architecture

    Popularity 5/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 02 2023
    Anjali Sharma
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.