Hello,
I have sent a PR in order to clean up the DefaultImplementation class and
make it simpler, in a way that we are no more using reflection for each
call to DefaultImplementation class.

Summary of the contents of the patch:
- introduce an interface, PulsarClientImplementationBinding, that defines
the binding between the API and the Impl (this interface lives in the "api"
module)
- load the implementation PulsarClientImplementationBindingImpl (that lives
in the "impl" module) only once, during Client API bootstrap
- the  PulsarClientImplementationBindingImpl class accesses Pulsar Impl
classes directly, without Java reflection

With this change:
- it will be easier to work on the Pulsar Client, as there is no more that
indirection, that used "strings", so the IDE could not understand the
relationships between the classes
- we are no more hiding "exception" throws by the DefaultImplementation
- at runtime we will save CPU cycles
- at runtime there will be no more uncertainty about the "classloader" who
is loading the Implementation class (so we do not need to rely on Context
ClassLoader or other tricks)


More details in the PR
https://github.com/apache/pulsar/pull/11636

Please take a look, I believe it is a good step forward, in many directions

Regards
Enrico

Reply via email to