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
Class loader issues in AvroRpcTest with Quarkus 2.0.0.Alpha3 #2651 #2859
Conversation
b7eac39
to
880af41
Compare
@JiriOndrusek is there any reason why this PR is against |
@ppalaga yes, you are right. I forgot that the current main already uses camel 3.11. I rebased PR. |
05a542e
to
571703d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite elegant!
Tests are still using jetty http server - but only in scope test.
I cannot find the scope change for the jetty artifact. Is it there?
Unfortunatelly there is no public access to these methods (which have to be used in http server) - HttpTranscier#readBuffers, HttpTransciever#writeBuffers and HttpTransciever#writeLength. For that reason, vertx request handler has to leverage RespondServlet, which requires creation of very simple
HttpServletRequest
andHttpServletResponse
, which basically wrapsbyte[]
.
It makes sense to ask whether it is possible to make these methods public (or for example through creations of class called VertxResponder). If yes,VertxHttpServer.java
could be simplified - but that would be covered by follow-up issue.
+1 this PR is OK for now, we can ask Avro to change the visibility and improve our code once they do. Actually when asking for some changes there, an avro-ipc artifact without the Servlet API dependency would be nice.
@ppalaga It seems, that we don't need to use any blocking feature of vertx here, camel component waits for the response of the server. But there is a small issue here. Vertx logs warnings if thread is blocked for more than 2000 ms.
My understanding is that ResponderServlet.service() entails the execution of the whole Camel route. We never know whether the code in the route is or is not going to block. Hence we have to handle it as blocking. @davsclaus may want to correct me if I am wrong.
...t/src/main/java/org/apache/camel/quarkus/component/avro/rpc/deployment/AvroRpcProcessor.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/camel/quarkus/component/avro/rpc/spi/HttpServletResponseWithBytes.java
Outdated
Show resolved
Hide resolved
...c/runtime/src/main/java/org/apache/camel/quarkus/component/avro/rpc/spi/VertxHttpServer.java
Outdated
Show resolved
Hide resolved
Yeah - we had to deal with the same problem in the |
571703d
to
3e0ad61
Compare
3e0ad61
to
835ae9d
Compare
...c/runtime/src/main/java/org/apache/camel/quarkus/component/avro/rpc/spi/VertxHttpServer.java
Show resolved
Hide resolved
Follow-up issue #2861 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @jamesnetherton would you like to throw a final look?
I have filed #2862 for the OpenStack failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me, so let's merge as-is.
I still think there's potentially some room to optimise things a bit, but I need to dig into the Quarkus Vert.x internals before creating any follow-up issues.
fixes #2651
supersedes #2845
Adds support of new SPI - apache/camel#5714
This enhancement uses vertx for the http server. Servers are started for required ports ad are managed via quarkus.
Tests are still using jetty http server - but only in scope test.
Unfortunatelly there is no public access to these methods (which have to be used in http server) - HttpTranscier#readBuffers, HttpTransciever#writeBuffers and HttpTransciever#writeLength. For that reason, vertx request handler has to leverage RespondServlet, which requires creation of very simple
HttpServletRequest
andHttpServletResponse
, which basically wrapsbyte[]
.It makes sense to ask whether it is possible to make these methods public (or for example through creations of class called VertxResponder). If yes,
VertxHttpServer.java
could be simplified - but that would be covered by follow-up issue.@ppalaga It seems, that we don't need to use any blocking feature of vertx here, camel component waits for the response of the server. But there is a small issue here. Vertx logs warnings if thread is blocked for more than 2000 ms. I'm not sure whether this could affect users. (but it doesn't affect the functionality) WDYT?