-
Notifications
You must be signed in to change notification settings - Fork 647
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
JMS: Remove speparate Envelope wrapper by doubling message classes #1331
Conversation
But I wonder if all this is worth it. The overhead of JMS is so much bigger than anything else anyway. |
@andreas-schroeder @akara Do you think this is a good idea? |
@ennru I feel that the most distinguishing factor here are the downsides of the respective solutions. However, both variants have their downsides, and I don't see a clear winner.
So I don't have an opinion here, really :) |
I find the user API with the combined message and envelope surprisingly small. The duplication in classes is hidden. I'm more afraid users may need more esoteric notations for the type parameters, especially in Java. |
I would not make this change just to save on the cost of the envelope object. Newer JVMs make both the creation and garbage collection cost of such objects more or less meaningless, especially compared to the cost and the potential message rate of JMS. With performance concerns put away, I'd look at this change more of API aesthetics. |
As it stands right now, we have the passthrough version of the message as a superclass and the non-passthrough version as a subclass. I'm wondering whether that is the right arrangement. We cannot take away a field in the subclass and therefore we mark it as Also, from a Scala perspective, I'd rather want to see the |
I agree that the inheritance I'll try and see if a |
I looked into this again and I don't think there is a good solution where we'd have a more natural inheritance for pass-throughs classes. |
Needs a rebase. |
c132464
to
4d73946
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.
LGTM. I think streamlining the API especially the Java side is worth of this change.
Removes
ProducerMessage.Envelope
which wrapped all messages pass to theJmsProducerStage
. Instead, all message classes themselves know about pass-throughs and have "pass-through-free" sub-classes to live without a type-parameter.Surprisingly small change for the user.