king / king-http-client Goto Github PK
View Code? Open in Web Editor NEWAn asynchronous http client with support for sse
License: Other
An asynchronous http client with support for sse
License: Other
When handling a redirect response that has a relative location,
we try to build the new URL with ServerInfo.buildFromUri
which fails with a relative location (e.x.: /foo
)
We should either: Have a better error that relative URIs are not supported to follow redirects, or make the redirect enrich the URI with the absolute part of the HttpRequestContext
Brief description:
After "connecting" to the BackEnd the idle-timeout seems to cause the connection to crash - which should probably not happen. I have also tried to set the idleTimeoutMills and totalRequestTimeoutMills to higher values like 10000 ms - same issue.
Reproducability:
Version 3.0.18
Code:
SseClient sseClient= httpClient.createSSE("https://datagate.dev:6040/api/v1/events")
.addHeader("Authorization", "Bearer " + APIConnection.token)
.build()
.execute(new SseClientCallback() {
@Override
public void onConnect() {
logger.info("Connected to the SSE-Backend!");
}
@Override
public void onDisconnect() {
logger.info("Disconnected from the SSE-Backend!");
}
@Override
public void onError(Throwable throwable) {
logger.error("SSE-Error: " + throwable.toString());
throwable.printStackTrace();
}
}
Error:
23:26:18.908 [HttpClient-HttpCallback 2] INFO d.d.api.rest.sse.EventHandler - Connected to the SSE-Backend!
23:26:19.986 [HttpClient-HttpCallback 1] ERROR d.d.api.rest.sse.EventHandler - SSE-Error: com.king.platform.net.http.netty.TimeoutException: Idle timeout of 1000 ms was 1077 ms since last event
com.king.platform.net.http.netty.TimeoutException: Idle timeout of 1000 ms was 1077 ms since last event
at com.king.platform.net.http.netty.IdleTimeoutTimerTask.run(IdleTimeoutTimerTask.java:66)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:682)
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:757)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:485)
at java.lang.Thread.run(Thread.java:748)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.