Giter VIP home page Giter VIP logo

Comments (1)

stevehu avatar stevehu commented on May 12, 2024

The issue is resolved by upgrading the client to Http2Client so that connection pooling is not necessary as HTTP 2.0 protocol supports multiplex. The user have two options in term of cache connection:

  • If you client will be calling service very frequently, then get the connection info from cluster and create a connection and cache it and reuse it. However, the cached connection might be disconnected from the server side(server down etc.) you need to check the connection state before using it. Follow these tutorial to see how it is used.

https://networknt.github.io/light-rest-4j/tutorial/ms-chain/
https://networknt.github.io/light-rest-4j/tutorial/discovery/

Also there is an example client here.

https://github.com/networknt/light-example-4j/tree/master/client

  • The other option is to create a new connection for each request and close the connection after the request. This pattern is suitable for infrequent calls to services as it doesn't make sense to hold the resource. Take a look at the example client to see how this is done.

https://github.com/networknt/light-example-4j/tree/master/client

from light-4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.