-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Refactor ResteasyReactiveOutputStream so that it can be used by Quarkus CXF #40995
Conversation
Would you like to review @cescoffier ? |
This comment has been minimized.
This comment has been minimized.
6f46052: removed the byte-buddy-maven-plugin from the new module |
This comment has been minimized.
This comment has been minimized.
Please update the description with information about what this change enables. Asking because for someone just seeing the PR out of the blue (or looking back at it a few months in the future), there is no context on why this was added. |
import io.vertx.core.json.JsonArray; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
public class VertxBufferImpl implements Buffer { |
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.
Why is this needed? Don't we already have this class elsewhere?
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.
Thanks for the hint. This one was supposed to be moved from independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxBufferImpl.java
, but I forgot to remove the old one. Which I am going to do right now.
There is still one more in extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxBufferImpl.java
which can be removed in favor of this one. Which I am going to do as well.
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.
I would like to ask you to add a little Javadoc to the classes you are going to use in CXF, as these classes are now no longer going to be internal, so it would be nice for integrators to know a little about what each one does.
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.
Hm... now I see there is also io.vertx.core.buffer.impl.BufferImpl
that does some additional bounds checks. I guess the two VertxBufferImpl
do not do it intentionally for performance reasons?
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.
I would like to ask you to add a little Javadoc
Haha, I can try
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.
🙏🏼
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.
I guess the two VertxBufferImpl do not do it intentionally for performance reasons?
OK, if so, I guess, it won't be so straightforward to move the refactored classes to Vert.x due to our "unsafe" BufferImpl
. Therefore, I am going to rename the module to quarkus-vertx-java-io
in line with the expectation that it will stay in Quarkus. Also, because the module is now used also in quarkus-vertx
and quarkus-websockets-next
, I am going to move it to directly under independent-projects
.
No problem, done. |
This comment has been minimized.
This comment has been minimized.
1a6ba5d:
|
cc @mkouba for the websockets-next change |
|
||
<groupId>io.quarkus.vertx-java-io</groupId> | ||
<artifactId>quarkus-vertx-java-io</artifactId> | ||
<name>Ancillary classes for using Vert.x with frameworks designed to read/write from/to java.io streams</name> |
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.
I'm not so sure we should create an independent project for this kind of stuff. AFAIK there are some drawbacks related to version management, release process, etc.
@gsmet may know more.
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.
Also quarkus-vertx-java-io
feels really weird. I'd call it quarkus-vertx-buffer
.
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.
I'm not so sure we should create an independent project for this kind of stuff. AFAIK there are some drawbacks related to version management, release process, etc. @gsmet may know more.
+1 about the concern about the version management. I was hoping all was automated given that there are several independent projects already. Anyway, I am open to discuss where the module should be hosted. WDYT @gsmet?
Also
quarkus-vertx-java-io
feels really weird. I'd call itquarkus-vertx-buffer
.
Re-using the VertxBufferImpl
was rather a secondary idea. The module was primarily intended to host the VertxOutputStream
and perhaps also other java.io stream implementations usable for old frameworks wanting to run on top of Vert.x. I do not care much about the module name. quarkus-vertx-java-io
, quarkus-vertx-buffer
or even quarkus-vertx-web-utils
would work for me.
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.
Re-using the VertxBufferImpl was rather a secondary idea.
In that case something like quarkus-vertx-utils
might make more sense...
BTW I also found io.quarkus.resteasy.runtime.standalone.VertxOutputStream
. Isn't it a copy of the original VertxOutputStream
?
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.
Re-using the VertxBufferImpl was rather a secondary idea.
In that case something like
quarkus-vertx-utils
might make more sense...
OK, let me rename it to quarkus-vertx-utils
unless nobody has a better idea.
BTW I also found
io.quarkus.resteasy.runtime.standalone.VertxOutputStream
. Isn't it a copy of the originalVertxOutputStream
?
They are different. The VertxOutputStream from resteasy-reactive-vertx extends java.io.OutputStream rather than org.jboss.resteasy.spi.AsyncOutputStream
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.
I'm not so sure we should create an independent project for this kind of stuff. AFAIK there are some drawbacks related to version management, release process, etc.
I can't remember there being any such drawbacks
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.
I'm not so sure we should create an independent project for this kind of stuff. AFAIK there are some drawbacks related to version management, release process, etc.
I can't remember there being any such drawbacks
There are some version properties in various independent projects, which have to be kept in sync on various places. This PR makes the mess a bit worse by adding two new properties in the new module.
It would be nice to hear what @gsmet thinks.
independent-projects/vertx-java-io/src/main/java/io/quarkus/vertx/java/io/VertxBufferImpl.java
Outdated
Show resolved
Hide resolved
independent-projects/vertx-java-io/src/main/java/io/quarkus/vertx/java/io/VertxBufferImpl.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
That's been failing a bit. Likely related. |
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.
We can merge this but I would like us to start the discussion to move this to Vert.x as I would like us to get rid of it at some point in the future.
This PR is motivated by Quarkus CXF's need to have a class similar to
org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveOutputStream
. Because it is not trivial to get right and currently cumbersome to keep in sync, this PR refactorsResteasyReactiveOutputStream
, so that it can be re-used by Quarkus CXF and possibly other frameworks needing to pass HTTP responses via ajava.io.OutputStream
.In particular, this PR does the following:
ResteasyReactiveOutputStream
independent of RESTeasyvertx-web
but does not depend on RESTeasyIf the new module will work well, we may consider moving it to Vert.x
ResteasyReactiveOutputStream
so that it can be used by Quarkus CXF #40994