-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
MessageCrypto interface should not expose Netty ByteBuf class in the API #10616
Conversation
I have added the |
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
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.
Overall LGTM
but the build failed
the build failed:
Error: COMPILATION ERROR :
Error: /home/runner/work/pulsar/pulsar/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:[3090,42] method decrypt in interface org.apache.pulsar.client.api.MessageCrypto<MetadataT,BuilderT> cannot be applied to given types;
required: java.util.function.Supplier,java.nio.ByteBuffer,java.nio.ByteBuffer,org.apache.pulsar.client.api.CryptoKeyReader
found: ()->messageMetadata,io.netty.buffer.ByteBuf,org.apache.pulsar.client.api.CryptoKeyReader
reason: actual and formal argument lists differ in length
Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project pulsar-broker: Compilation failure
Error: /home/runner/work/pulsar/pulsar/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:[3090,42] method decrypt in interface org.apache.pulsar.client.api.MessageCrypto<MetadataT,BuilderT> cannot be applied to given types;
Error: required: java.util.function.Supplier,java.nio.ByteBuffer,java.nio.ByteBuffer,org.apache.pulsar.client.api.CryptoKeyReader
Error: found: ()->messageMetadata,io.netty.buffer.ByteBuf,org.apache.pulsar.client.api.CryptoKeyReader
Error: reason: actual and formal argument lists differ in length
Error: -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
looks like we need care some implementation in the tests. but this change will make the management easier. +1. |
Motivation
MessageCrypto
is included inpulsar-client-api
and it's exposing NettyByteBuf
in its API.The problem is that we are shading Netty and the classes are renamed. We must not have external libraries symbols as part of our API.
The result is that Netty symbols are exposed as
org.apache.pulsar.shade.io.netty...
and therefore are not going to be interoperable with other libraries.Because of this,
pulsar-client-api
was also included into the shaded Jars and that brings in other issues (like missing the sources/javadocs of the PulsarClient APIs).Modifications
pulsar-client-api
java.nio.ByteBuffer
in API