Bug 678166 - Examples need to be cleaned up and some removed/replaced
Summary: Examples need to be cleaned up and some removed/replaced
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 1.3
Hardware: Unspecified
OS: Unspecified
medium
urgent
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-16 23:24 UTC by William Henry
Modified: 2013-04-15 14:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-15 14:48:13 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description William Henry 2011-02-16 23:24:20 UTC
Description of problem:

The old API examples are still shipped and in the highlevel dir than the examples for the new API. This is very confusing for new users.

Old examples should be moved to a old_api_examples directory.
New examples should be promoted up and different examples to their own directories.

We need more examples too.  I moved the feeddemo upstream but it's stuck in a jira.  We could do with  HA examples that doesn't require clustering. etc. 

The idea is that newbies need to find current useful examples quickly. NOT old confusing examples.

More comments welcome.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Gordon Sim 2011-02-17 09:29:15 UTC
Which rpms do you have installed? I don't see the old examples:

# rpm -qv qpid-cpp-client-devel
qpid-cpp-client-devel-0.7.946106-28.el5
# rpm -ql qpid-cpp-client-devel | grep examples
/usr/share/qpidc/examples/messaging
/usr/share/qpidc/examples/messaging/Makefile
/usr/share/qpidc/examples/messaging/OptionParser.cpp
/usr/share/qpidc/examples/messaging/OptionParser.h
/usr/share/qpidc/examples/messaging/client.cpp
/usr/share/qpidc/examples/messaging/drain.cpp
/usr/share/qpidc/examples/messaging/hello_world.cpp
/usr/share/qpidc/examples/messaging/hello_xml.cpp
/usr/share/qpidc/examples/messaging/map_receiver.cpp
/usr/share/qpidc/examples/messaging/map_sender.cpp
/usr/share/qpidc/examples/messaging/server.cpp
/usr/share/qpidc/examples/messaging/spout.cpp

Comment 2 William Henry 2011-02-18 02:22:15 UTC
I'll check my MRG install. Perhaps this should be a Jira for upstream instead.

Comment 3 William Henry 2011-02-18 17:32:21 UTC
We are not shipping the old examples. Good.

However this doesn't address the organization of the current examples and the lack of detailed examples.  

To use drain and spout you kinda need to know the addressing. 

We need more examples of addressing for different cases. True that we encourage people to setup queues and exchanges using qpid-config. (I'm not sure if we explicitly encourage this in the docs.)

Suggestions:

Examples that actually script different exchange/queue/binding setup/remove etc.

Examples that show various addressing in C++ API. Some programmers will be using MRG-M for building up infrastructure - e.g. wrapping existing infrastructure calls. Therefore managing exchange/queue/binding setup through Sender and Receiver addressing will be done programmatically.

Examples that show how addressing to setup and use topic exchange and topics.

Other suggestions. The feeddemo (moved upstream) shows how to do addressing for Receivers of topics. (may need review).

Comment 4 William Henry 2011-02-18 17:35:24 UTC

Example for a topic (using Ruby with C++ API):

newtopic = "my-topic;{node:{type:topic, x-declare:{type:topic}}, {create:always}"
sender = session.createSender(newtopic)

Comment 5 Gordon Sim 2011-02-18 17:48:33 UTC
I don't think dynamically creating exchanges in this way is a very common pattern and most cases that think they need to do that don't really need to at all. I would not want to encourage people to follow that pattern as it is more error prone as well as being more complex and scary in the addressing options.

Examples 2.5 and 2.6 in the Programming Guide to explain how to use addresses for simple topic use cases.


Note You need to log in before you can comment on or make changes to this bug.