summaryrefslogtreecommitdiff
path: root/cpp/examples/fanout/fanout_producer.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-10-24 00:45:11 +0000
committerTed Ross <tross@apache.org>2008-10-24 00:45:11 +0000
commit55c976dbede7ada5dbcc581945f7d5b1a038344c (patch)
treeade284127ba75103b85d5b431bed78c500896af8 /cpp/examples/fanout/fanout_producer.cpp
parentbd0c16218e3ccc75ce997ba9f0806c27e6468085 (diff)
downloadqpid-python-55c976dbede7ada5dbcc581945f7d5b1a038344c.tar.gz
QPID-1348 - Dynamic binding for federation. Parameterized exchange names for CPP examples
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@707515 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/fanout/fanout_producer.cpp')
-rw-r--r--cpp/examples/fanout/fanout_producer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/examples/fanout/fanout_producer.cpp b/cpp/examples/fanout/fanout_producer.cpp
index a1ca407847..bb253d7027 100644
--- a/cpp/examples/fanout/fanout_producer.cpp
+++ b/cpp/examples/fanout/fanout_producer.cpp
@@ -64,6 +64,7 @@ using std::string;
int main(int argc, char** argv) {
const char* host = argc>1 ? argv[1] : "127.0.0.1";
int port = argc>2 ? atoi(argv[2]) : 5672;
+ string exchange = argc>3 ? argv[3] : "amq.fanout";
Connection connection;
Message message;
try {
@@ -86,13 +87,13 @@ int main(int argc, char** argv) {
message.setData(message_data.str());
// Asynchronous transfer sends messages as quickly as
// possible without waiting for confirmation.
- async(session).messageTransfer(arg::content=message, arg::destination="amq.fanout");
+ async(session).messageTransfer(arg::content=message, arg::destination=exchange);
}
// And send a final message to indicate termination.
message.setData("That's all, folks!");
- session.messageTransfer(arg::content=message, arg::destination="amq.fanout");
+ session.messageTransfer(arg::content=message, arg::destination=exchange);
//-----------------------------------------------------------------------------