'PrematureCloseException: Connection premium closed DURING response' occurs when using WebClient - rest

In normal cases, WebClient works well, but an exception occurs on particular api call.
The error log is as follows.
reactor.core.Exceptions$ReactiveException: reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response
Why is this happening?
Is there an API that is not supported WebClient calls?

Related

what can cause this exception? io.vertx.core.impl.NoStackTraceThrowable: Connection is not active now, current status: CLOSED

i had built a http server by vertx-web, and it has working well for several days.
but today, when i make some http request, there sometimes throw this exception: "io.vertx.core.impl.NoStackTraceThrowable: Connection is not active now, current status: CLOSED".
what make me confused is that not every http request will throw this exception, and for the same http uri, if i change the request params, this exception may happen, but not every time.
i wanne know why and thanks for you answer.

Service response is a 502 Bad Gateway error with generic "Server Error" HTML block?

I wrote a Node service that takes parameters from a client and puts them into a SOAP request to another (3rd party) service. Lately, when a request is made to my service, the initial response is a 502 Bad Gateway error with a generic HTML block titled "Server Error" (see image). When I submit the same request a second time, the 3rd party responds with a 500 Internal Server error and a message indicating that a request has already been issued for that transaction.
Obviously the initial request made it to the 3rd party somehow, but they say that the 502 error isn't theirs and isn't logged in their system as ever having occurred.
What I'm trying to find out is if the error is somehow coming from my service because of Docker or Azure (or something else I'm not thinking of). The error is so generic that research hasn't yielded anything useful on it. Has anyone encountered this or know what it is?
It turns out that this was an error being thrown by Azure (or so we think) as the result of some faulty error-handling. Part of the response was being parsed incorrectly, which caused the app to stall. It still doesn't explain how the data still got to the other side while this was happening (or why it hit the catch block at all when there was no error in the processing), but if you see a server error returned with this HTML block, check your error-handling code and investigate Azure!

In Vertx webclient how to log http request and response

What is the simplest way for logging outgoing http request and response in Vertx WebClient. I'm looking for something similar to the httpserver LoggerHandler, but then for the webclient thus outgoing requests.
WebClient has an overloaded create(Vertx, WebClientOptions) method.
WebClientOptions has a setLogActivity() method that accepts a boolean parameter that indicates if network activity should be logged.
(disclaimer: i haven't tried this myself so i can't vouch for what's actually logged, but see if that covers your needs).

Adobe CQ5 - How to handle Session Timeout

I want to know something about the Session Timeout on the Day CQSE HTTP Service. Is it possible to handle the exception that is thrown knowing that it is actually a Session Timeout Exception? I mean, on the controller part of the system (I use Java Spring), the exception I got is a NullPointerException after the timeout minutes has passed, and at this point the session is already reseted, making not possible to inform the user that his session has timed out, but only that "An error ocurred".
Thanks a lot,

Is there a way to log only REST request bodies that fail with an internal server error in Spring

I am trying to log the request bodies for REST services(POST request body) that fail when there is some kind of internal server error. I don't want to log all the request bodies as that will take a lot of memory on my disc.
The exception is happening somewhere in the dao layer (like a Key constraint or some kind of unhandled exception), where I don't have the access to the entire request.
I tried using some aop advices(after-throws) but I was not able to log the required information.
Can someone suggest an approach that needs to be followed to log the request body.
I use RESTful(javax.ws.rs) webservices.
Since no response was given, I ended up using a filter http://static.springsource.org/spring-framework/docs/3.2.0.M2/api/org/springframework/web/filter/AbstractRequestLoggingFilter.html