| Summary: | 2.5 Sender Capacity and Replay needs more coding details. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | William Henry <whenry> | ||||
| Component: | Messaging_Programming_Reference | Assignee: | Joshua Wulf <jwulf> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | ecs-bugs | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 2.0 | CC: | chetan, iboverma, jskeoch, lcarlon | ||||
| Target Milestone: | 2.2 | Keywords: | Documentation | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-09-20 03:13:18 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
Created attachment 530750 [details]
Modified section 2.5 with code examples.
In my attached document I have in the C++ part of the table:
// Later
if (sender.getUnsettled())
{
session.synch();
}
Instead it should be:
// Later
if (sender.getUnsettled())
{
session.sync();
}
Notice the removal of the 'h' from synch() to sync().
Asynchronous Message Sending Example: http://deathstar1.usersys.redhat.com:8080/TopicIndex/Books/editor/preview.html?skyneturl=http://skynet.usersys.redhat.com:8080/TopicIndex&topicid=8384 Query Sender Capacity: http://deathstar1.usersys.redhat.com:8080/TopicIndex/Books/editor/preview.html?skyneturl=http://skynet.usersys.redhat.com:8080/TopicIndex&topicid=8054 Interestingly, the Python API docs do not list a capacity property for a sender object, although it is mentioned in the send method: http://qpid.apache.org/apis/0.14/python/html/qpid.messaging.endpoints.Sender-class.html It is incorporated, it's attached to the bug for future reference. Released for MRG 2.2 |
Description of problem: Section 2.5 Sender Capacity and Replay requires more details. At no point does it show how to program sending asynchronous messages and doesn't show the code to check the available capacity or the unsettled messages. Example this paragraph requires more details: "The sender can be queried for the available space (the unused capacity), and for the current count of unsettled messages (those held in the replay list pending confirmation by the server). When the unsettled count is zero, all messages on that sender have been successfully sent." Something like this would be better: "The sender can be queried for the available space (the unused capacity) using the Sender class method getAvailable(). The current count of unsettled messages (those held in the replay list pending confirmation by the server) can be checked using the Sender class method getUnsettled()." It should include some coding example and explicitly mention the appropriate methods and classes. Some notes below on an example. Depending on what you want to do the following is helpful. Assume you've setCapacity to some number. e.g. sender.setCapacity(MY_CAPACITY); // set MY_CAPACITY set using and arg // not using a #define ;-) Then: bool resend = true; while (resend) { if (sender.getAvailable()>0) { sender.send(message,false); resend = false; } else { // May wish to do nothing here or send to log std::cout << "Warning: Capacity full. Retry" << std::endl; } } You can check how many are outstanding by using getUnsettled(). e.g. at the end you might want to: if (sender.getUnsettled()) { session.synch(); } I will try to rewrite this section and add examples. I'll upload a doc with the info because I may wish to include a table with C++ and Python APIs. BTW what does a Java developer do for this? Is it part of JMS? I don't remember MessageProducer having such an API. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: