[Bug] Connector cannot access methods from pulsar-client-original
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
- OS: macOS 13.4.1 m1
- Pulsar: 3.0.0
### Minimal reproduce step
See https://github.com/BewareMyPower/pulsar-sink-demo
### What did you expect to see?
It should succeed.
### What did you see instead?
ClassCastException
### Anything else?
From https://github.com/apache/pulsar/pull/17835, it seems that we need to use reflection to access methods and classes in the module. But it harms the user experience.
> The root problem is that connectors should not bundle the Pulsar client impl because it's provided at runtime by the Java Functions framework.
From the PR description, it seems to be related to how the Java Functions framework loads the connector. Ideally, it should use the default classpath of Pulsar broker.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start with the pulsar-sink-demo reproduction and read PR 17835 alongside the Java Functions framework class-loading behavior. Trace how the connector obtains the Pulsar client and how the client implementation is bundled; done means the connector can access the required methods without a ClassCastException and without bundling the runtime-provided client implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100