diff options
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/examples/messaging/client.cpp | 7 | ||||
-rw-r--r-- | qpid/cpp/examples/messaging/hello_world.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/examples/messaging/hello_xml.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/examples/messaging/map_receiver.cpp | 5 | ||||
-rw-r--r-- | qpid/cpp/examples/messaging/map_sender.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/examples/messaging/server.cpp | 5 |
6 files changed, 19 insertions, 10 deletions
diff --git a/qpid/cpp/examples/messaging/client.cpp b/qpid/cpp/examples/messaging/client.cpp index 483e5f8744..f0ecd96206 100644 --- a/qpid/cpp/examples/messaging/client.cpp +++ b/qpid/cpp/examples/messaging/client.cpp @@ -38,9 +38,10 @@ using std::string; int main(int argc, char** argv) { const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672"; - - Connection connection(url); - try { + std::string connectionOptions = argc > 2 ? argv[2] : ""; + + Connection connection(url, connectionOptions); + try { connection.open(); Session session = connection.createSession(); diff --git a/qpid/cpp/examples/messaging/hello_world.cpp b/qpid/cpp/examples/messaging/hello_world.cpp index 9c06964a66..8aef57d5d0 100644 --- a/qpid/cpp/examples/messaging/hello_world.cpp +++ b/qpid/cpp/examples/messaging/hello_world.cpp @@ -11,7 +11,9 @@ using namespace qpid::messaging; int main(int argc, char** argv) { std::string broker = argc > 1 ? argv[1] : "localhost:5672"; std::string address = argc > 2 ? argv[2] : "amq.topic"; - Connection connection(broker); + std::string connectionOptions = argc > 3 ? argv[3] : ""; + + Connection connection(broker, connectionOptions); try { connection.open(); Session session = connection.createSession(); diff --git a/qpid/cpp/examples/messaging/hello_xml.cpp b/qpid/cpp/examples/messaging/hello_xml.cpp index ab6de25b16..99b4144b17 100644 --- a/qpid/cpp/examples/messaging/hello_xml.cpp +++ b/qpid/cpp/examples/messaging/hello_xml.cpp @@ -12,6 +12,8 @@ using namespace qpid::messaging; int main(int argc, char** argv) { std::string broker = argc > 1 ? argv[1] : "localhost:5672"; + std::string connectionOptions = argc > 2 ? argv[2] : ""; + std::string query = "let $w := ./weather " "return $w/station = 'Raleigh-Durham International Airport (KRDU)' " @@ -32,7 +34,7 @@ int main(int argc, char** argv) { " } " "}"; - Connection connection(broker); + Connection connection(broker, connectionOptions); try { connection.open(); Session session = connection.createSession(); diff --git a/qpid/cpp/examples/messaging/map_receiver.cpp b/qpid/cpp/examples/messaging/map_receiver.cpp index ca170788aa..081f7394a8 100644 --- a/qpid/cpp/examples/messaging/map_receiver.cpp +++ b/qpid/cpp/examples/messaging/map_receiver.cpp @@ -38,8 +38,9 @@ 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); + std::string connectionOptions = argc > 3 ? argv[3] : ""; + + Connection connection(url, connectionOptions); try { connection.open(); Session session = connection.createSession(); diff --git a/qpid/cpp/examples/messaging/map_sender.cpp b/qpid/cpp/examples/messaging/map_sender.cpp index 2d348ded6e..8ce3e1d8ec 100644 --- a/qpid/cpp/examples/messaging/map_sender.cpp +++ b/qpid/cpp/examples/messaging/map_sender.cpp @@ -38,7 +38,9 @@ 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); + std::string connectionOptions = argc > 3 ? argv[3] : ""; + + Connection connection(url, connectionOptions); try { connection.open(); Session session = connection.createSession(); diff --git a/qpid/cpp/examples/messaging/server.cpp b/qpid/cpp/examples/messaging/server.cpp index ae1fee4b50..ab72694c61 100644 --- a/qpid/cpp/examples/messaging/server.cpp +++ b/qpid/cpp/examples/messaging/server.cpp @@ -39,8 +39,9 @@ using std::string; int main(int argc, char** argv) { const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672"; - - Connection connection(url); + std::string connectionOptions = argc > 3 ? argv[3] : ""; + + Connection connection(url, connectionOptions); try { connection.open(); Session session = connection.createSession(); |