search

Home  >  Q&A  >  body text

How to implement java http long connection push data?

Two java services, connected using http long connection, pushed from service one to service two. I would like to ask, how should the two services be implemented?

Thanks

扔个三星炸死你扔个三星炸死你2707 days ago925

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-06-28 09:24:59

    Correction

    Just checked

    In fact, if you use the latest HTTP components, they can already optimize this problem by themselves

    Feign uses the JDK's native URLConnection to send HTTP requests by default. There is no connection pool, but a long connection is maintained for each address, that is, the persistence connection of HTTP is used. We can replace Feign's original http client with Apache's HTTP Client to gain control over performance such as connection pools and timeouts. Spring Cloud supports this replacement starting from Brixtion.SR5 version. First declare Apache HTTP Client and feign-httpclient dependencies in the project

    `

    reply
    0
  • 巴扎黑

    巴扎黑2017-06-28 09:24:59

    socket.io

    reply
    0
  • Cancelreply