summaryrefslogtreecommitdiff
path: root/cpp/examples/messaging
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-07-19 11:00:45 +0000
committerGordon Sim <gsim@apache.org>2010-07-19 11:00:45 +0000
commitff9258ec1ced8a4abcef008ae14dc3ba07c7be34 (patch)
tree6c175443cb579a998e717f4e0555eecd5d2479ee /cpp/examples/messaging
parent9007cdedc237f270dbfdd2dd11c5bc84918c2b13 (diff)
downloadqpid-python-ff9258ec1ced8a4abcef008ae14dc3ba07c7be34.tar.gz
Make address used for map sender/receiver configurable; make default create the queue automatically.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@965424 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/messaging')
-rw-r--r--cpp/examples/messaging/map_receiver.cpp3
-rw-r--r--cpp/examples/messaging/map_sender.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/cpp/examples/messaging/map_receiver.cpp b/cpp/examples/messaging/map_receiver.cpp
index 6afc4c9ec9..ca170788aa 100644
--- a/cpp/examples/messaging/map_receiver.cpp
+++ b/cpp/examples/messaging/map_receiver.cpp
@@ -37,12 +37,13 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+ const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
Connection connection(url);
try {
connection.open();
Session session = connection.createSession();
- Receiver receiver = session.createReceiver("message_queue");
+ Receiver receiver = session.createReceiver(address);
Variant::Map content;
decode(receiver.fetch(), content);
std::cout << content << std::endl;
diff --git a/cpp/examples/messaging/map_sender.cpp b/cpp/examples/messaging/map_sender.cpp
index 489ddb7761..2d348ded6e 100644
--- a/cpp/examples/messaging/map_sender.cpp
+++ b/cpp/examples/messaging/map_sender.cpp
@@ -37,11 +37,12 @@ using std::string;
int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+ const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
Connection connection(url);
try {
connection.open();
Session session = connection.createSession();
- Sender sender = session.createSender("message_queue");
+ Sender sender = session.createSender(address);
Message message;
Variant::Map content;