[feat][client] PCIP-5 Support Pull Consumer (#24)


### Motivation
Our organization is currently planning a migration from RocketMQ to Pulsar. To facilitate this transition, we aim to implement a standardized abstraction layer for MQ clients that encapsulates implementation details of specific messaging systems. This abstraction layer will allow seamless engine replacement while maintaining consistent client interfaces. However, two critical compatibility issues hinder the unification of message fetching patterns between RocketMQ/Kafka and Pulsar:

**1. Interface Disparity:**

- Pulsar currently lacks native support for offset-based message fetching (fetch/pull paradigm) that allows specifying exact message positions and batch sizes.

**2. Positioning Mechanism Mismatch:**

- RocketMQ/Kafka: Utilize monotonically increasing numerical offsets for message positioning and acknowledgment
- Pulsar: Relies on composite MessageID (ledgerId + entryId + batchIndex) for message identification.

Therefore, I propose to contribute a customized feature implementation to the Pulsar contributor repository that leverages existing Pulsar APIs to achieve functionality similar to RocketMQ's pull consumer. This implementation could serve companies like ours with standardized client requirements, allowing them to reuse this solution.


### Modifications
1. Upgrade Pulsar version to 4.0.8(features include PIP-415 a new API to get the message id by offset) #23 
2. Implement RocketMQ-like pull consumer functionality using existing Pulsar APIs.
19 files changed
tree: 729286fca3b151a18fe1056d38b4b558ac34efa2
  1. .github/
  2. .mvn/
  3. best-practice-blogs/
  4. etc/
  5. pcip/
  6. pulsar-admin-mcp-contrib/
  7. pulsar-auth-contrib/
  8. pulsar-bookkeeper-contrib/
  9. pulsar-client-common-contrib/
  10. pulsar-connector-contrib/
  11. pulsar-function-contrib/
  12. pulsar-interceptor-contrib/
  13. pulsar-loadbalance-contrib/
  14. pulsar-metrics-contrib/
  15. pulsar-rpc-contrib/
  16. pulsar-transaction-contrib/
  17. src/
  18. .asf.yaml
  19. .gitattributes
  20. .gitignore
  21. contributedFeatures.md
  22. contributionGuides.md
  23. customizationFeatures.md
  24. LICENSE
  25. mvnw
  26. mvnw.cmd
  27. pom.xml
  28. README.md
  29. SECURITY.md
  30. sort_order.xml
README.md

Apache Pulsar Java Contrib

Pulsar java contrib is to provide a non-core code maintenance repository to collect plugin implementations, personalized features, experimental features, and best practices from users.

This project follows the terms of Apache License 2.0. You can format the code by mvn spotless:apply and generate license headers by mvn license:format. Please note that the code formatted by Spotless may still not meet the formatting requirements. Please run mvn checkstyle:check for inspection.

Contributing

pulsar-java-contrib is actively in development. If you have some common use cases for plugins, please contact us and we‘ll be happy to support. Please open an issue to share your idea or suggestion. PRs are always welcome and greatly appreciated, but for larger functional changes a pre-coding introduction can be helpful to ensure this is the correct place and that active or conflicting efforts don’t exist.

Development Process

Compared with pulsar , pulsar-java-contrib is faster, and there is no need to send emails for DISCUSSION and VOTE. it can be summarized as follows:

  1. for simple changes, you only need to submit a PR for code changes
  2. for larger improvement proposal, you need to submit a PR for code changes + a design document (the file is placed in pcip/pcip-xxx.md) For detailed development process description, see: pcip/README.md