-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support HTTP redirects with VertxHttpClientHTTPConduit
#1609
Comments
Do you have any stack trace by any chance? This would be to see where in the flow the exception happens. The main two suspects are accessing the remote service endpoint and accessing the remote WSDL. But could also be something else. |
I researched this issue a bit more yesterday and the problem seems to lie in sending a POST SOAP request to the remote service endpoint. We don't do dynamic WSDL fetches. The Vertx HTTP Factory seems to disable redirection for POST requests (per documentation), and there is no simple option to enable it. One must define a custom redirection handler. The URLConnectionHTTPConduit on the other hand seems to enable redirection for GET and POST requests by default, so we didn't have this problem before, and setting this as the Conduit factory fixed the problem. This is quite a breaking change for us as a lot of our services send out POST SOAP requests, and all of them need to be updated with the fix after the dependency update. Perhaps it might be worth documenting this potential issue? Please let me know if you need more information. |
Thanks for the info, @dcheng1248. I really appreciate it as our aim is to make VertxHttpClientHTTPConduitFactory a drop in replacement for URLConnectionHTTPConduitFactory. I'll have a look how redirecting could be enabled for the VertxHttpClientHTTPConduitFactory. |
VertxHttpClientHTTPConduit
@dcheng1248 the fix is available in Quarkus Platform 3.17.0. It would be great to hear whether it fulfills all your needs. |
@ppalaga many thanks for the quick update and notification. I will test it out soon and report back. |
@ppalaga I just did a test and unfortunately there still seems to be an issue at the unit test level. I'm actually not sure if this is related to the request data caching vs offloading you mentioned, so any advice would be appreciated. Our request body is very small FWIW, < 10 lines of XML. If my issue is not related to the cache vs offloading, I think this reflects different behaviours of the two HTTP Conduits. I will give the information I can but need to redact/change some things. Unit test mocks:
Tests done: Results: 3.16: 3.17:
Upon further investigation, removal of .withRequestBody(matchingXPath(...)) in the stub of RequestFinal() made the test pass. So it seems like it did redirect the request, but the body is not included in the redirected request? I tried to look through the source code but could not find the reason quickly. PS: One tiny bug I did notice is that in VertxHttpClientHTTPConduit.redirectRetransmit, both the URLs in the debug log refer to the redirection URL (in the previous method the new URL is already added to the list, so list.size()-1 is the new URL, not the old one). PPS: If it's not too difficult to implement, being able to switch on logging the redirection responses and requests might also help with debugging. Thanks a lot for your help again. |
@dcheng1248 thanks for the report, I have created a new issue #1630 - let's continue there. |
When sending SOAP requests with the default VertxHttpClientHTTPConduitFactory I get a HTTP 302 Redirection error.
The request works outside the app and the problem is solved by setting
quarkus.cxf.http-conduit-factory=URLConnectionHTTPConduitFactory
Not sure what is causing this error in the new default factory, any advice would be appreciated.
The text was updated successfully, but these errors were encountered: