Repository navigation
Conversation
… shipped 0.3.1-alpha API Replace the retired 0.1.0-era snippets (MessagingAccessPointFactory, createBytesMessageToTopic, Promise/PromiseListener, poll/headers, NonStandardKeys) with the API used by the bundled runnable examples (OMS.getMessagingAccessPoint, createBytesMessage, Future listener, receive/ack, sysHeaders, OMSBuiltinKeys), add the missing push consumer startup() and the OMS_RMQ_DIRECT_NAME_SRV prerequisite.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11342 +/- ##
=============================================
- Coverage 49.75% 49.71% -0.05%
- Complexity 14354 14366 +12
=============================================
Files 1390 1390
Lines 103246 103262 +16
Branches 13502 13504 +2
=============================================
- Hits 51375 51340 -35
- Misses 45679 45724 +45
- Partials 6192 6198 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Rewrites Example_OpenMessaging.md to match the shipped 0.3.1-alpha API, replacing stale OMSProducer code with the current SimpleProducer/SimpleConsumer/PullConsumer classes.
Findings
- [Info] The code examples now use
OMS.getMessagingAccessPoint()instead of the deprecatedMessagingAccessPointFactory, andcreateBytesMessage()instead ofcreateBytesMessageToTopic(). These match the actual API. - [Info] The async send example correctly uses
Future<SendResult>withaddListenerinstead of the oldPromise/PromiseListenerpattern. - [Info] The
CountDownLatchin the producer example ensures the async callback completes before shutdown. Good practice. - [Warning] The consumer example uses
CountDownLatchwith a 30s timeout. Consider mentioning in the doc that this is just for demo purposes and real applications would use a long-running consumer loop.
Cross-repo Note
This is a docs-only change in apache/rocketmq. No protocol or client changes required.
Automated review by github-manager-bot
d0e1459 to
7d2c19d
Compare
|
Hi @RongtongJin, sorry for the ping — this PR has been open for a while without a review yet. The change is small and focused (rewrite Example_OpenMessaging for the shipped 0.3.1-alpha AP…), and all tests and CI pass on my side. Would you mind taking a look when you get a chance? If it looks good, merging it would be much appreciated — happy to adjust anything if needed. Thanks a lot! |
Which Issue(s) This PR Fixes
Fixes #11325
Brief Description
Rewrites the three snippets in
docs/en/Example_OpenMessaging.mdto the API of the OpenMessaging implementation this repository actually ships (io.openmessaging:openmessaging-api0.3.1-alpha,pom.xml:114), mirroring the runnable examples inexample/.../openmessaging/:OMS.getMessagingAccessPoint("oms:rocketmq://localhost:9876/default:default")instead ofMessagingAccessPointFactory+ the oldopenmessaging:URL scheme;createBytesMessageinstead ofcreateBytesMessageToTopic;Future+ listener instead ofPromise/PromiseListener;receive()/ack/sysHeaders/Message.BuiltinKeysinstead ofpoll()/headers()/MessageHeader;OMSBuiltinKeys.CONSUMER_IDinstead ofNonStandardKeys.CONSUMER_GROUP;consumer.startup(), which was missing entirely;OMS_RMQ_DIRECT_NAME_SRV=trueprerequisite the examples require.How Did You Test This Change?
Each rewritten snippet was extracted, prepended with the import block of its corresponding runnable example, and compiled against the built module jars:
javac -cp openmessaging/target/classes:openmessaging-api-0.3.1-alpha.jar→ success for all three (SimpleProducer, SimplePullConsumer, SimplePushConsumer). The snippets otherwise matchexample/src/main/java/org/apache/rocketmq/example/openmessaging/*at the PR base commit, where they compile as part of the example module.