diff options
author | Alan Conway <aconway@apache.org> | 2007-12-14 20:49:14 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-12-14 20:49:14 +0000 |
commit | 74f5716fc2a614bb456374948457db2750a2f716 (patch) | |
tree | b8c7365418237f37b32910a608fdf7c58893f706 /cpp | |
parent | 4930af608c6763a41eed4985bb5460a7bf8eb6b9 (diff) | |
download | qpid-python-74f5716fc2a614bb456374948457db2750a2f716.tar.gz |
examples/Makefile.am: Fixed build failures.
Removed unused files:
examples/examples/direct/direct_persistent_config_queues.cpp
examples/examples/direct/direct_persistent_publisher.cpp
examples/examples/direct/direct_publisher.cpp
examples/examples/fanout/fanout_publisher.cpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@604291 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/examples/Makefile.am | 24 | ||||
-rw-r--r-- | cpp/examples/examples/direct/direct_persistent_config_queues.cpp | 101 | ||||
-rw-r--r-- | cpp/examples/examples/direct/direct_persistent_publisher.cpp | 111 | ||||
-rw-r--r-- | cpp/examples/examples/direct/direct_publisher.cpp | 104 | ||||
-rw-r--r-- | cpp/examples/examples/fanout/fanout_publisher.cpp | 102 |
5 files changed, 13 insertions, 429 deletions
diff --git a/cpp/examples/Makefile.am b/cpp/examples/Makefile.am index 9e6e77f37f..73b7a84ad0 100644 --- a/cpp/examples/Makefile.am +++ b/cpp/examples/Makefile.am @@ -8,19 +8,20 @@ nobase_pkgdata_DATA= \ examples/fanout/Makefile \ examples/fanout/declare_queues.cpp \ examples/fanout/listener.cpp \ - examples/fanout/fanout_publisher.cpp \ + examples/fanout/fanout_producer.cpp \ examples/pub-sub/Makefile \ examples/pub-sub/topic_publisher.cpp \ examples/pub-sub/topic_listener.cpp \ examples/direct/Makefile \ - examples/direct/direct_publisher.cpp \ - examples/direct/direct_persistent_config_queues.cpp \ + examples/direct/direct_producer.cpp \ examples/direct/listener.cpp \ - examples/direct/declare_queues.cpp \ - examples/direct/direct_persistent_publisher.cpp - -EXTRA_DIST=$(nobase_pkgdata_DATA) + examples/direct/declare_queues.cpp +EXTRA_DIST=$(nobase_pkgdata_DATA) verify \ + examples/request-response/verify.in \ + examples/fanout/verify.in \ + examples/pub-sub/verify.in \ + examples/direct/verify.in # Note: we don't use normal automake SUBDIRS because the example # makefiles don't understand all the recursive automake targets. @@ -29,23 +30,24 @@ clean-local: cd examples; $(MAKE) clean rm -f examples/*/*.out examples/*/*.wait -abs_srcdir=@abs_srcdir@ abs_top_builddir=@abs_top_builddir@ abs_top_srcdir=@abs_top_srcdir@ +VERIFY=$(abs_top_srcdir)/examples/verify + # Build the examples in the source tree. all-local: cd examples && $(MAKE) CXX="$(CXX)" CXXFLAGS="-I../../$(top_srcdir)/src -I../../$(top_srcdir)/src/gen -I../../$(top_builddir)/src/gen -L../../$(top_builddir)/src/.libs -Wl,-rpath,$(abs_top_builddir)/src/.libs" all # Verify the examples in the buid tree. -check-local: - cd examples && QPIDD=$(abs_top_builddir)/src/qpidd $(abs_top_srcdir)/examples/verify +check-local: all-local + cd examples && QPIDD=$(abs_top_builddir)/src/qpidd $(VERIFY) # Build and verify the installed examples, then clean up to avoid rpmbuild warnings. EXAMPLE_FLAGS=-I$(DESTDIR)$(includedir) -L$(DESTDIR)$(libdir) -Wl,-rpath,$(DESTDIR)$(libdir) EXAMPLE_DIR=$(DESTDIR)$(pkgdatadir)/examples installcheck-local: cd $(EXAMPLE_DIR) && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(EXAMPLE_FLAGS)" all - cd $(EXAMPLE_DIR) && QPIDD=$(DESTDIR)$(sbindir)/qpidd $(abs_srcdir)/verify + cd $(EXAMPLE_DIR) && QPIDD=$(sbindir)/qpidd $(VERIFY) cd $(EXAMPLE_DIR) && $(MAKE) clean diff --git a/cpp/examples/examples/direct/direct_persistent_config_queues.cpp b/cpp/examples/examples/direct/direct_persistent_config_queues.cpp deleted file mode 100644 index afe076278b..0000000000 --- a/cpp/examples/examples/direct/direct_persistent_config_queues.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * direct_config_durable_queues.cpp - * - * This program is one of a set of programs designed to be used - * together. These programs do not specify the exchange type - the - * default exchange type is the direct exchange. - * - * direct_config_queues.cpp: - * - * Creates a queue on a broker, binding a routing key to route - * messages to that queue. - * - * - * direct_publisher.cpp: - * - * Publishes to a broker, specifying a routing key. - * - * direct_listener.cpp - * - * Reads from a queue on the broker using a message listener. - * - * direct_persistent_publisher.cpp: - * - * Publishes a combination of persistent and transient messages - * to a broker, specifying a routing key. The persistent messages - * survive server restart, the transient ones do not (unless the - * queues are configured as durable queues). - * - * direct_config_durable_queues.cpp (this program): - * - * Creates a queue on a broker, binding a routing key to route - * messages to that queue. Uses persistent queues, so all - * messages on the queue survive server restart. - * - * - */ - -#include <qpid/client/Connection.h> -#include <qpid/client/Session.h> - -#include <unistd.h> -#include <cstdlib> -#include <iostream> - -using namespace qpid::client; -using namespace qpid::framing; - -using std::string; - - -int main() { - Connection connection; - Message msg; - try { - connection.open("127.0.0.1", 5672); - Session session = connection.newSession(); - - - //--------- Main body of program -------------------------------------------- - - // Create a queue named "message_queue", and route all messages whose - // routing key is "routing_key to this newly created queue. - - session.queueDeclare(arg::queue="message_queue"); - session.queueBind(arg::queue="message_queue", arg::routingKey="routing_key"); - - - //----------------------------------------------------------------------------- - - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cout << error.what() << std::endl; - } - return 1; - -} - - - diff --git a/cpp/examples/examples/direct/direct_persistent_publisher.cpp b/cpp/examples/examples/direct/direct_persistent_publisher.cpp deleted file mode 100644 index 75637c7eb9..0000000000 --- a/cpp/examples/examples/direct/direct_persistent_publisher.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - -/** - * direct_publisher.cpp: - * - * This program is one of three programs designed to be used - * together. These programs do not specify the exchange type - the - * default exchange type is the direct exchange. - * - * direct_config_queues.cpp: - * - * Creates a queue on a broker, binding a routing key to route - * messages to that queue. - * - * direct_publisher.cpp (this program): - * - * Publishes to a broker, specifying a routing key. - * - * direct_listener.cpp - * - * Reads from a queue on the broker using a message listener. - * - */ - - -#include <qpid/client/Connection.h> -#include <qpid/client/Session.h> -#include <qpid/client/Message.h> - - -#include <unistd.h> -#include <cstdlib> -#include <iostream> - -#include <sstream> - -using namespace qpid::client; -using namespace qpid::framing; - -using std::stringstream; -using std::string; - -int main() { - Connection connection; - Message message; - try { - connection.open("127.0.0.1", 5672 ); - Session session = connection.newSession(); - - //--------- Main body of program -------------------------------------------- - - // The routing key is a message property. We will use the same - // routing key for each message, so we'll set this property - // just once. (In most simple cases, there is no need to set - // other message properties.) - - message.getDeliveryProperties().setRoutingKey("routing_key"); - - // Now send some messages ... - - for (int i=0; i<10; i++) { - stringstream message_data; - message_data << "Message " << i; - message.setData(message_data.str()); - - // Make odd-numbered messages persistent - - if (i % 1) - message.getDeliveryProperties().setDeliveryMode(PERSISTENT); - else - message.getDeliveryProperties().setDeliveryMode(TRANSIENT); - - session.messageTransfer(arg::content=message); - } - - // And send a final message to indicate termination. - - message.setData("That's all, folks!"); - session.messageTransfer(arg::content=message); - - //----------------------------------------------------------------------------- - - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cout << error.what() << std::endl; - } - return 1; -} - - diff --git a/cpp/examples/examples/direct/direct_publisher.cpp b/cpp/examples/examples/direct/direct_publisher.cpp deleted file mode 100644 index 5135f926c3..0000000000 --- a/cpp/examples/examples/direct/direct_publisher.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - -/** - * direct_publisher.cpp: - * - * This program is one of three programs designed to be used - * together. These programs do not specify the exchange type - the - * default exchange type is the direct exchange. - * - * direct_config_queues.cpp: - * - * Creates a queue on a broker, binding a routing key to route - * messages to that queue. - * - * direct_publisher.cpp (this program): - * - * Publishes to a broker, specifying a routing key. - * - * direct_listener.cpp - * - * Reads from a queue on the broker using a message listener. - * - */ - - -#include <qpid/client/Connection.h> -#include <qpid/client/Session.h> -#include <qpid/client/Message.h> - - -#include <unistd.h> -#include <cstdlib> -#include <iostream> - -#include <sstream> - -using namespace qpid::client; -using namespace qpid::framing; - -using std::stringstream; -using std::string; - -int main() { - Connection connection; - Message message; - try { - connection.open("127.0.0.1", 5672 ); - Session session = connection.newSession(); - - //--------- Main body of program -------------------------------------------- - - // The routing key is a message property. We will use the same - // routing key for each message, so we'll set this property - // just once. (In most simple cases, there is no need to set - // other message properties.) - - message.getDeliveryProperties().setRoutingKey("routing_key"); - - // Now send some messages ... - - for (int i=0; i<10; i++) { - stringstream message_data; - message_data << "Message " << i; - - message.setData(message_data.str()); - session.messageTransfer(arg::content=message); - } - - // And send a final message to indicate termination. - - message.setData("That's all, folks!"); - session.messageTransfer(arg::content=message); - - //----------------------------------------------------------------------------- - - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cout << error.what() << std::endl; - } - return 1; -} - - diff --git a/cpp/examples/examples/fanout/fanout_publisher.cpp b/cpp/examples/examples/fanout/fanout_publisher.cpp deleted file mode 100644 index 976c53aae4..0000000000 --- a/cpp/examples/examples/fanout/fanout_publisher.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - -/** - * direct_publisher.cpp: - * - * This program is one of three programs designed to be used - * together. These programs do not specify the exchange type - the - * default exchange type is the direct exchange. - * - * direct_config_queues.cpp: - * - * Creates a queue on a broker, binding a routing key to route - * messages to that queue. - * - * direct_publisher.cpp (this program): - * - * Publishes to a broker, specifying a routing key. - * - * direct_listener.cpp - * - * Reads from a queue on the broker using a message listener. - * - */ - - -#include <qpid/client/Connection.h> -#include <qpid/client/Session.h> -#include <qpid/client/Message.h> - - -#include <unistd.h> -#include <cstdlib> -#include <iostream> - -#include <sstream> - -using namespace qpid::client; -using namespace qpid::framing; - -using std::stringstream; -using std::string; - -int main() { - Connection connection; - Message message; - try { - connection.open("127.0.0.1", 5672 ); - Session session = connection.newSession(); - - //--------- Main body of program -------------------------------------------- - - // Unlike topic exchanges and direct exchanges, a fanout - // exchange need not set a routing key. - - Message message; - - // Now send some messages ... - - for (int i=0; i<10; i++) { - stringstream message_data; - message_data << "Message " << i; - - message.setData(message_data.str()); - session.messageTransfer(arg::content=message, arg::destination="amq.fanout"); - } - - // And send a final message to indicate termination. - - message.setData("That's all, folks!"); - session.messageTransfer(arg::content=message, arg::destination="amq.fanout"); - - //----------------------------------------------------------------------------- - - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cout << error.what() << std::endl; - } - return 1; -} - - |