Closed onobc closed 2 weeks ago
Hello @onobc
Thank you for the issue here too, just a quick question for clarity: The Pulsar client lib does not shade com.google.protobuf:protobuf-java and it is causing user's problems as described in original post
Indeed the pulsar-client lib is not shading it, but is it the real issue? If it would it may break others as well isnt it?
Hi @nandorholozsnyak
pulsar-client lib is not shading it, but is it the real issue? If it would it may break others as well isnt it? Indeed the pulsar-client lib is not shading it, but is it the real issue?
If one were to pull spring-pulsar
out of the equation and consume the pulsar-client
lib directly, they would transitively consume the older version of protobuf-java
which could cause problems.
Hi @onobc Thank you so much for the info.
Looks like this may get fixed in Pulsar proper as well: https://github.com/apache/pulsar/pull/23468
Hehe, it is happening :D What a coincidence.
The Pulsar client lib does not shade
com.google.protobuf:protobuf-java
and it is causing user's problems as described in original post by @nandorholozsnyak in https://github.com/spring-projects/spring-pulsar/issues/114#issuecomment-2399976242_Workaround 1
Upgrade to Pulsar client
3.3.2
as heprotobuf-java
has been updated to3.25.5
.If you plan on updating to the upcoming spring-pulsar
1.2.0-RC1
release (Spring Boot3.4.0-RC1
/ week of Oct 18) you will get this update automatically. If you don't plan on updating Spring Pulsar then, you can override the version of Pulsar as described here.This will bring the
protobuf-java
up to a recent version, solving the original author's issue, but will not fix future version mismatches.Workaround 2
You can exclude
protobuf-java
from the currentpulsar-client-all
and provide the more recent dependency (example here. Something like:Improvement 1
We already exclude some other unwanted dependencies from the Pulsar lib (here. We should likely exclude
protobuf-java
as well as we do include it explicitly already as optional dependency (here.We will try to get the above improvement into the upcoming
1.2.0-RC1
release as well.Improvement 2
We should also see about shading the protobuf-java lib in the Pulsar client libs to avoid this downstream required massaging.