From 633c33f224f3196f3f9bd80bd2e418d8143fea06 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 4 May 2012 15:39:19 +0000 Subject: QPID-3858: Updated branch - merged from trunk r.1333987 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1334037 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qmf/ruby/qmf.rb | 26 +- cpp/bindings/qmf/tests/run_interop_tests | 3 +- cpp/bindings/qpid/Makefile.am | 2 +- cpp/bindings/qpid/dotnet/Makefile.am | 2 - cpp/bindings/qpid/python/python.i | 42 +- cpp/bindings/qpid/ruby/README.rdoc | 2 +- cpp/bindings/qpid/ruby/Rakefile | 4 +- .../features/step_definitions/address_steps.rb | 19 + .../features/step_definitions/connection_steps.rb | 19 + .../features/step_definitions/receiver_steps.rb | 19 + .../ruby/features/step_definitions/sender_steps.rb | 19 + .../features/step_definitions/session_steps.rb | 19 + cpp/bindings/qpid/ruby/lib/qpid/encoding.rb | 6 +- cpp/bindings/qpid/ruby/lib/qpid/version.rb | 2 +- cpp/bindings/swig_python_typemaps.i | 6 +- cpp/configure.ac | 75 +- cpp/design_docs/new-ha-design.txt | 93 +- cpp/etc/Makefile.am | 25 +- cpp/etc/cluster.conf-example.xml.in | 70 ++ cpp/etc/qpidd | 118 --- cpp/etc/qpidd-primary.in | 102 +++ cpp/etc/qpidd.in | 119 +++ cpp/include/qpid/Options.h | 4 +- cpp/include/qpid/Url.h | 6 +- cpp/include/qpid/framing/Array.h | 22 +- cpp/include/qpid/framing/FieldTable.h | 56 +- cpp/include/qpid/framing/SequenceNumber.h | 6 +- cpp/include/qpid/framing/SequenceSet.h | 6 +- cpp/include/qpid/sys/MemStat.h | 38 - cpp/include/qpid/types/Variant.h | 4 +- cpp/managementgen/qmfgen/management-types.xml | 2 +- cpp/managementgen/qmfgen/schema.py | 14 +- cpp/managementgen/qmfgen/templates/Class.h | 59 +- cpp/managementgen/qmfgen/templates/Event.h | 13 +- cpp/managementgen/qmfgen/templates/Package.h | 5 +- cpp/rubygen/framing.0-10/structs.rb | 26 +- cpp/src/CMakeLists.txt | 52 +- cpp/src/Makefile.am | 25 +- cpp/src/acl.mk | 2 + cpp/src/config.h.cmake | 1 + cpp/src/ha.mk | 16 +- cpp/src/posix/QpiddBroker.cpp | 17 +- cpp/src/qmf.mk | 1 + cpp/src/qmf/BrokerImportExport.h | 42 + cpp/src/qpid/Options.cpp | 7 +- cpp/src/qpid/Url.cpp | 17 +- cpp/src/qpid/UrlArray.cpp | 2 + cpp/src/qpid/UrlArray.h | 1 - cpp/src/qpid/acl/Acl.cpp | 183 +++- cpp/src/qpid/acl/Acl.h | 75 +- cpp/src/qpid/acl/AclConnectionCounter.cpp | 214 +++++ cpp/src/qpid/acl/AclConnectionCounter.h | 81 ++ cpp/src/qpid/acl/AclData.cpp | 572 ++++++++---- cpp/src/qpid/acl/AclData.h | 89 +- cpp/src/qpid/acl/AclPlugin.cpp | 4 +- cpp/src/qpid/acl/AclReader.cpp | 222 ++--- cpp/src/qpid/acl/AclReader.h | 80 +- cpp/src/qpid/acl/AclValidator.cpp | 61 +- cpp/src/qpid/acl/AclValidator.h | 24 +- cpp/src/qpid/acl/management-schema.xml | 34 + cpp/src/qpid/agent/ManagementAgentImpl.cpp | 11 +- cpp/src/qpid/broker/AclModule.h | 191 +++- cpp/src/qpid/broker/Bridge.cpp | 15 +- cpp/src/qpid/broker/Bridge.h | 13 +- cpp/src/qpid/broker/Broker.cpp | 7 +- cpp/src/qpid/broker/Broker.h | 87 +- cpp/src/qpid/broker/Connection.cpp | 16 +- cpp/src/qpid/broker/Connection.h | 5 + cpp/src/qpid/broker/ConnectionHandler.cpp | 1 + cpp/src/qpid/broker/ConnectionHandler.h | 1 - cpp/src/qpid/broker/DirectExchange.cpp | 3 +- cpp/src/qpid/broker/DirectExchange.h | 4 +- cpp/src/qpid/broker/DtxManager.cpp | 29 +- cpp/src/qpid/broker/DtxManager.h | 3 + cpp/src/qpid/broker/DtxWorkRecord.cpp | 11 +- cpp/src/qpid/broker/Exchange.cpp | 28 +- cpp/src/qpid/broker/Exchange.h | 2 +- cpp/src/qpid/broker/ExchangeRegistry.cpp | 3 + cpp/src/qpid/broker/ExchangeRegistry.h | 6 +- cpp/src/qpid/broker/Fairshare.cpp | 1 + cpp/src/qpid/broker/FanOutExchange.cpp | 2 +- cpp/src/qpid/broker/FanOutExchange.h | 4 +- cpp/src/qpid/broker/HeadersExchange.cpp | 3 +- cpp/src/qpid/broker/HeadersExchange.h | 4 +- cpp/src/qpid/broker/LegacyLVQ.cpp | 29 +- cpp/src/qpid/broker/LegacyLVQ.h | 1 + cpp/src/qpid/broker/Link.cpp | 263 +++++- cpp/src/qpid/broker/Link.h | 58 +- cpp/src/qpid/broker/LinkRegistry.cpp | 31 +- cpp/src/qpid/broker/LinkRegistry.h | 110 +-- cpp/src/qpid/broker/Message.cpp | 8 +- cpp/src/qpid/broker/MessageDeque.cpp | 20 +- cpp/src/qpid/broker/MessageDeque.h | 7 +- cpp/src/qpid/broker/MessageGroupManager.cpp | 92 +- cpp/src/qpid/broker/MessageGroupManager.h | 19 +- cpp/src/qpid/broker/MessageMap.cpp | 78 +- cpp/src/qpid/broker/MessageMap.h | 2 +- cpp/src/qpid/broker/PriorityQueue.cpp | 118 ++- cpp/src/qpid/broker/PriorityQueue.h | 27 +- cpp/src/qpid/broker/Queue.cpp | 667 +++++++++----- cpp/src/qpid/broker/Queue.h | 147 ++-- cpp/src/qpid/broker/QueueListeners.cpp | 4 - cpp/src/qpid/broker/QueueListeners.h | 7 +- cpp/src/qpid/broker/QueuedMessage.cpp | 34 + cpp/src/qpid/broker/QueuedMessage.h | 3 + cpp/src/qpid/broker/SaslAuthenticator.cpp | 1 + cpp/src/qpid/broker/SemanticState.cpp | 4 +- cpp/src/qpid/broker/SemanticState.h | 65 +- cpp/src/qpid/broker/SessionAdapter.cpp | 51 +- cpp/src/qpid/broker/SessionAdapter.h | 4 +- cpp/src/qpid/broker/SessionHandler.cpp | 5 + cpp/src/qpid/broker/SessionHandler.h | 10 +- cpp/src/qpid/broker/TopicExchange.cpp | 3 +- cpp/src/qpid/broker/TopicExchange.h | 4 +- cpp/src/qpid/broker/windows/SaslAuthenticator.cpp | 1 + cpp/src/qpid/client/Connection.cpp | 2 +- cpp/src/qpid/client/ConnectionHandler.cpp | 10 +- cpp/src/qpid/client/ConnectionImpl.cpp | 4 +- cpp/src/qpid/client/LoadPlugins.cpp | 6 +- cpp/src/qpid/client/SessionImpl.cpp | 2 +- cpp/src/qpid/client/SslConnector.cpp | 4 +- cpp/src/qpid/client/TCPConnector.cpp | 8 +- cpp/src/qpid/client/amqp0_10/AddressResolution.cpp | 1 + cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp | 3 +- cpp/src/qpid/cluster/Cluster.cpp | 28 +- cpp/src/qpid/cluster/ClusterMap.cpp | 4 +- cpp/src/qpid/cluster/ClusterTimer.cpp | 2 + cpp/src/qpid/cluster/Connection.cpp | 49 ++ cpp/src/qpid/cluster/Connection.h | 2 + cpp/src/qpid/cluster/CredentialsExchange.cpp | 3 +- cpp/src/qpid/cluster/CredentialsExchange.h | 2 +- cpp/src/qpid/cluster/FailoverExchange.cpp | 2 +- cpp/src/qpid/cluster/FailoverExchange.h | 2 +- cpp/src/qpid/cluster/InitialStatusMap.cpp | 2 +- cpp/src/qpid/cluster/UpdateClient.cpp | 11 +- cpp/src/qpid/cluster/UpdateDataExchange.cpp | 4 +- cpp/src/qpid/cluster/UpdateDataExchange.h | 3 +- cpp/src/qpid/framing/AMQFrame.h | 3 +- cpp/src/qpid/framing/BodyHandler.cpp | 56 -- cpp/src/qpid/framing/BodyHandler.h | 56 -- cpp/src/qpid/framing/FieldTable.cpp | 219 ++++- cpp/src/qpid/framing/FrameSet.cpp | 5 +- cpp/src/qpid/framing/FrameSet.h | 1 + cpp/src/qpid/framing/MethodContent.h | 2 +- cpp/src/qpid/framing/TransferContent.cpp | 2 +- cpp/src/qpid/framing/TransferContent.h | 2 +- cpp/src/qpid/framing/amqp_framing.h | 1 - cpp/src/qpid/ha/Backup.cpp | 36 +- cpp/src/qpid/ha/Backup.h | 4 +- cpp/src/qpid/ha/BrokerReplicator.cpp | 190 ++-- cpp/src/qpid/ha/BrokerReplicator.h | 16 +- cpp/src/qpid/ha/HaBroker.cpp | 95 +- cpp/src/qpid/ha/HaBroker.h | 8 + cpp/src/qpid/ha/HaPlugin.cpp | 28 +- cpp/src/qpid/ha/QueueReplicator.cpp | 62 +- cpp/src/qpid/ha/QueueReplicator.h | 5 +- cpp/src/qpid/ha/ReplicateLevel.cpp | 72 ++ cpp/src/qpid/ha/ReplicateLevel.h | 52 ++ cpp/src/qpid/ha/ReplicatingSubscription.cpp | 71 +- cpp/src/qpid/ha/ReplicatingSubscription.h | 4 +- cpp/src/qpid/ha/Settings.h | 7 +- cpp/src/qpid/ha/management-schema.xml | 35 +- cpp/src/qpid/log/Statement.cpp | 44 + cpp/src/qpid/log/posix/SinkOptions.cpp | 8 +- cpp/src/qpid/management/ManagementAgent.cpp | 79 +- cpp/src/qpid/management/ManagementAgent.h | 4 +- .../qpid/management/ManagementDirectExchange.cpp | 8 +- cpp/src/qpid/management/ManagementDirectExchange.h | 4 +- .../qpid/management/ManagementTopicExchange.cpp | 8 +- cpp/src/qpid/management/ManagementTopicExchange.h | 4 +- .../qpid/replication/ReplicatingEventListener.cpp | 4 +- cpp/src/qpid/replication/ReplicationExchange.cpp | 11 +- cpp/src/qpid/replication/ReplicationExchange.h | 2 +- cpp/src/qpid/store/MessageStorePlugin.cpp | 6 +- cpp/src/qpid/store/ms-clfs/MessageLog.cpp | 8 +- cpp/src/qpid/store/ms-clfs/Transaction.h | 1 + cpp/src/qpid/store/ms-clfs/TransactionLog.cpp | 8 +- cpp/src/qpid/sys/MemStat.h | 38 + cpp/src/qpid/sys/Probes.h | 65 ++ cpp/src/qpid/sys/apr/APRBase.cpp | 89 -- cpp/src/qpid/sys/apr/APRBase.h | 74 -- cpp/src/qpid/sys/apr/APRPool.cpp | 41 - cpp/src/qpid/sys/apr/APRPool.h | 50 -- cpp/src/qpid/sys/apr/Condition.h | 84 -- cpp/src/qpid/sys/apr/Mutex.h | 124 --- cpp/src/qpid/sys/apr/Shlib.cpp | 49 -- cpp/src/qpid/sys/apr/Socket.cpp | 114 --- cpp/src/qpid/sys/apr/Thread.cpp | 34 - cpp/src/qpid/sys/apr/Thread.h | 106 --- cpp/src/qpid/sys/apr/Time.cpp | 36 - cpp/src/qpid/sys/posix/AsynchIO.cpp | 38 +- cpp/src/qpid/sys/posix/PollableCondition.cpp | 5 - cpp/src/qpid/sys/ssl/SslIo.cpp | 7 +- cpp/src/qpid/sys/windows/AsynchIO.cpp | 100 ++- cpp/src/qpid/sys/windows/PollableCondition.cpp | 5 - cpp/src/qpid/sys/windows/Socket.cpp | 10 +- cpp/src/qpid/sys/windows/SslAsynchIO.cpp | 8 +- cpp/src/qpid/xml/XmlExchange.cpp | 4 +- cpp/src/qpid/xml/XmlExchange.h | 2 +- cpp/src/qpidd.cpp | 4 + cpp/src/qpidd.h | 4 + cpp/src/tests/Array.cpp | 4 +- cpp/src/tests/CMakeLists.txt | 25 +- cpp/src/tests/ExchangeTest.cpp | 46 +- cpp/src/tests/FieldTable.cpp | 4 +- cpp/src/tests/Frame.cpp | 1 - cpp/src/tests/FramingTest.cpp | 1 + cpp/src/tests/Makefile.am | 23 +- cpp/src/tests/MessagingSessionTests.cpp | 7 + cpp/src/tests/QueueFlowLimitTest.cpp | 1 + cpp/src/tests/QueueTest.cpp | 52 +- cpp/src/tests/RefCounted.cpp | 6 +- cpp/src/tests/SessionState.cpp | 1 - cpp/src/tests/StringUtils.cpp | 6 +- cpp/src/tests/Uuid.cpp | 2 +- cpp/src/tests/acl.py | 957 +++++++++++++++------ cpp/src/tests/ais_check | 34 - cpp/src/tests/amqp_0_10/Map.cpp | 98 --- cpp/src/tests/amqp_0_10/ProxyTemplate.cpp | 49 -- cpp/src/tests/amqp_0_10/apply.cpp | 99 --- cpp/src/tests/amqp_0_10/handlers.cpp | 125 --- cpp/src/tests/amqp_0_10/serialize.cpp | 429 --------- cpp/src/tests/brokertest.py | 56 +- cpp/src/tests/cli_tests.py | 139 ++- cpp/src/tests/cluster.cmake | 2 +- cpp/src/tests/cluster.mk | 11 +- cpp/src/tests/cluster_failover | 19 + cpp/src/tests/cluster_python_tests | 3 +- cpp/src/tests/cluster_read_credit | 4 +- cpp/src/tests/cluster_test_logs.py | 6 +- cpp/src/tests/cluster_tests.py | 122 ++- cpp/src/tests/clustered_replication_test | 27 +- cpp/src/tests/cpg_check.sh.in | 38 + cpp/src/tests/federated_cluster_test | 35 +- cpp/src/tests/ha_tests.py | 523 ++++++++--- cpp/src/tests/install_env.sh.in | 2 +- cpp/src/tests/ipv6_test | 9 +- cpp/src/tests/logging.cpp | 9 +- cpp/src/tests/python_tests.ps1 | 5 +- cpp/src/tests/qpid-cluster-benchmark | 29 +- cpp/src/tests/qpid-cpp-benchmark | 69 +- cpp/src/tests/qpid-perftest.cpp | 12 +- cpp/src/tests/qpid-ping.cpp | 27 +- cpp/src/tests/qpid-send.cpp | 67 +- cpp/src/tests/qpid-txtest.cpp | 5 +- cpp/src/tests/qpidd-empty.conf | 3 + cpp/src/tests/queue_flow_limit_tests.py | 2 +- cpp/src/tests/reliable_replication_test | 6 +- cpp/src/tests/replication_test | 34 +- cpp/src/tests/ring_queue_test | 2 +- cpp/src/tests/run_acl_tests | 24 +- cpp/src/tests/run_acl_tests.ps1 | 5 +- cpp/src/tests/run_cli_tests | 4 +- cpp/src/tests/run_cluster_authentication_soak | 3 +- cpp/src/tests/run_cluster_authentication_test | 3 +- cpp/src/tests/run_cluster_test | 3 +- cpp/src/tests/run_cluster_tests | 4 +- cpp/src/tests/run_failover_soak | 3 +- cpp/src/tests/run_federation_sys_tests | 8 +- cpp/src/tests/run_federation_tests | 15 +- cpp/src/tests/run_federation_tests.ps1 | 3 +- cpp/src/tests/run_header_test.ps1 | 3 +- cpp/src/tests/run_msg_group_tests | 8 +- cpp/src/tests/run_msg_group_tests_soak | 4 +- cpp/src/tests/run_store_tests.ps1 | 9 +- cpp/src/tests/run_test.ps1 | 5 +- cpp/src/tests/sasl.mk | 21 +- cpp/src/tests/sasl_fed | 16 +- cpp/src/tests/sasl_fed_ex | 12 +- cpp/src/tests/sasl_fed_ex_dynamic_cluster | 4 +- cpp/src/tests/sasl_fed_ex_link_cluster | 3 +- cpp/src/tests/sasl_fed_ex_queue_cluster | 3 +- cpp/src/tests/sasl_fed_ex_route_cluster | 3 +- cpp/src/tests/ssl_test | 13 +- cpp/src/tests/start_cluster | 3 +- cpp/src/tests/test_env.ps1.in | 78 ++ cpp/src/tests/test_env.sh.in | 2 + cpp/src/tests/testagent.cpp | 11 +- cpp/src/tests/testlib.py | 4 +- cpp/src/tests/windows/DisableWin32ErrorWindows.cpp | 6 +- cpp/src/windows/QpiddBroker.cpp | 12 +- cpp/src/windows/SCM.cpp | 664 +++++++------- cpp/xml/cluster.xml | 6 + 283 files changed, 6975 insertions(+), 4900 deletions(-) create mode 100644 cpp/etc/cluster.conf-example.xml.in delete mode 100755 cpp/etc/qpidd create mode 100755 cpp/etc/qpidd-primary.in create mode 100755 cpp/etc/qpidd.in delete mode 100644 cpp/include/qpid/sys/MemStat.h create mode 100644 cpp/src/qmf/BrokerImportExport.h create mode 100644 cpp/src/qpid/acl/AclConnectionCounter.cpp create mode 100644 cpp/src/qpid/acl/AclConnectionCounter.h create mode 100644 cpp/src/qpid/broker/QueuedMessage.cpp delete mode 100644 cpp/src/qpid/framing/BodyHandler.cpp delete mode 100644 cpp/src/qpid/framing/BodyHandler.h create mode 100644 cpp/src/qpid/ha/ReplicateLevel.cpp create mode 100644 cpp/src/qpid/ha/ReplicateLevel.h create mode 100644 cpp/src/qpid/sys/MemStat.h create mode 100644 cpp/src/qpid/sys/Probes.h delete mode 100644 cpp/src/qpid/sys/apr/APRBase.cpp delete mode 100644 cpp/src/qpid/sys/apr/APRBase.h delete mode 100644 cpp/src/qpid/sys/apr/APRPool.cpp delete mode 100644 cpp/src/qpid/sys/apr/APRPool.h delete mode 100644 cpp/src/qpid/sys/apr/Condition.h delete mode 100644 cpp/src/qpid/sys/apr/Mutex.h delete mode 100644 cpp/src/qpid/sys/apr/Shlib.cpp delete mode 100644 cpp/src/qpid/sys/apr/Socket.cpp delete mode 100644 cpp/src/qpid/sys/apr/Thread.cpp delete mode 100644 cpp/src/qpid/sys/apr/Thread.h delete mode 100644 cpp/src/qpid/sys/apr/Time.cpp delete mode 100755 cpp/src/tests/ais_check delete mode 100644 cpp/src/tests/amqp_0_10/Map.cpp delete mode 100644 cpp/src/tests/amqp_0_10/ProxyTemplate.cpp delete mode 100644 cpp/src/tests/amqp_0_10/apply.cpp delete mode 100644 cpp/src/tests/amqp_0_10/handlers.cpp delete mode 100644 cpp/src/tests/amqp_0_10/serialize.cpp create mode 100755 cpp/src/tests/cluster_failover create mode 100755 cpp/src/tests/cpg_check.sh.in create mode 100644 cpp/src/tests/qpidd-empty.conf create mode 100644 cpp/src/tests/test_env.ps1.in (limited to 'cpp') diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb index 34d3255d8d..9fbd50cbf6 100644 --- a/cpp/bindings/qmf/ruby/qmf.rb +++ b/cpp/bindings/qmf/ruby/qmf.rb @@ -26,18 +26,28 @@ module Qmf # Pull all the TYPE_* constants into Qmf namespace. Maybe there's an easier way? Qmfengine.constants.each do |c| + c = c.to_s if c.index('TYPE_') == 0 or c.index('ACCESS_') == 0 or c.index('DIR_') == 0 or c.index('CLASS_') == 0 or c.index('SEV_') == 0 const_set(c, Qmfengine.const_get(c)) end end + module StringHelpers + def ensure_encoding(str) + enc = (Encoding.default_external.name || "UTF-8" rescue "UTF-8") + str.respond_to?(:force_encoding) ? str.force_encoding(enc) : str + end + end + class Util + include StringHelpers + def qmf_to_native(val) case val.getType when TYPE_UINT8, TYPE_UINT16, TYPE_UINT32 then val.asUint when TYPE_UINT64 then val.asUint64 - when TYPE_SSTR, TYPE_LSTR then val.asString + when TYPE_SSTR, TYPE_LSTR then ensure_encoding(val.asString) when TYPE_ABSTIME then val.asInt64 when TYPE_DELTATIME then val.asUint64 when TYPE_REF then ObjectId.new(val.asObjectId) @@ -161,6 +171,7 @@ module Qmf ##============================================================================== class ConnectionSettings + include StringHelpers attr_reader :impl def initialize(url = nil) @@ -192,7 +203,7 @@ module Qmf def get_attr(key) _v = @impl.getAttr(key) if _v.isString() - return _v.asString() + return ensure_encoding(_v.asString()) elsif _v.isUint() return _v.asUint() elsif _v.isBool() @@ -348,7 +359,7 @@ module Qmf @broker = kwargs[:broker] if kwargs.include?(:broker) @allow_sets = :true - if cls: + if cls @event_class = cls @impl = Qmfengine::Event.new(@event_class.impl) elsif kwargs.include?(:impl) @@ -434,7 +445,7 @@ module Qmf @allow_sets = :false @broker = kwargs[:broker] if kwargs.include?(:broker) - if cls: + if cls @object_class = cls @impl = Qmfengine::Object.new(@object_class.impl) elsif kwargs.include?(:impl) @@ -707,6 +718,8 @@ module Qmf end class MethodResponse + include StringHelpers + def initialize(impl) @impl = Qmfengine::MethodResponse.new(impl) end @@ -720,7 +733,7 @@ module Qmf end def text - exception.asString + ensure_encoding(exception.asString) end def args @@ -885,6 +898,7 @@ module Qmf end class SchemaClassKey + include StringHelpers attr_reader :impl def initialize(i) @impl = Qmfengine::SchemaClassKey.new(i) @@ -899,7 +913,7 @@ module Qmf end def to_s - @impl.asString + ensure_encoding(@impl.asString) end end diff --git a/cpp/bindings/qmf/tests/run_interop_tests b/cpp/bindings/qmf/tests/run_interop_tests index 83e7f2593b..c370f211af 100755 --- a/cpp/bindings/qmf/tests/run_interop_tests +++ b/cpp/bindings/qmf/tests/run_interop_tests @@ -24,6 +24,7 @@ MY_DIR=`dirname \`which $0\`` QPID_DIR=${MY_DIR}/../../../.. BUILD_DIR=../../.. PYTHON_DIR=${QPID_DIR}/python +TOOLS_PY_DIR=${QPID_DIR}/tools/src/py QMF_DIR=${QPID_DIR}/extras/qmf QMF_DIR_PY=${QMF_DIR}/src/py BROKER_DIR=${BUILD_DIR}/src @@ -68,7 +69,7 @@ TESTS_FAILED=0 if test -d ${PYTHON_DIR} ; then start_broker echo "Running qmf interop tests using broker on port $BROKER_PORT" - PYTHONPATH=${PYTHON_DIR}:${QMF_DIR_PY}:${MY_DIR} + PYTHONPATH=${PYTHON_DIR}:${QMF_DIR_PY}:${MY_DIR}:${TOOLS_PY_DIR} export PYTHONPATH if test -d ${PYTHON_LIB_DIR} ; then diff --git a/cpp/bindings/qpid/Makefile.am b/cpp/bindings/qpid/Makefile.am index eaf45c2076..ae81696f27 100644 --- a/cpp/bindings/qpid/Makefile.am +++ b/cpp/bindings/qpid/Makefile.am @@ -35,7 +35,7 @@ if HAVE_PERL_DEVEL INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src -I$(PERL_INC) -EXTRA_DIST += perl/perl.i +EXTRA_DIST += perl/perl.i perl/CMakeLists.txt BUILT_SOURCES = perl/cqpid_perl.cpp SWIG_FLAGS = -w362,401 diff --git a/cpp/bindings/qpid/dotnet/Makefile.am b/cpp/bindings/qpid/dotnet/Makefile.am index f212a37bbe..82ae315578 100644 --- a/cpp/bindings/qpid/dotnet/Makefile.am +++ b/cpp/bindings/qpid/dotnet/Makefile.am @@ -80,7 +80,6 @@ EXTRA_DIST = configure-windows.ps1 \ examples/msvc9/csharp.map.callback.sender/csharp.map.callback.sender.csproj \ examples/msvc9/csharp.map.receiver/csharp.map.receiver.csproj \ examples/msvc9/csharp.map.sender/csharp.map.sender.csproj \ - extra_dist.txt \ Makefile.am \ msvc10/org.apache.qpid.messaging.sessionreceiver.sln \ msvc10/org.apache.qpid.messaging.sln \ @@ -93,7 +92,6 @@ EXTRA_DIST = configure-windows.ps1 \ src/AssemblyInfo.cpp \ src/Connection.cpp \ src/Connection.h \ - src/Duration.cpp \ src/Duration.h \ src/FailoverUpdates.cpp \ src/FailoverUpdates.h \ diff --git a/cpp/bindings/qpid/python/python.i b/cpp/bindings/qpid/python/python.i index 9d45bf54ee..a53cf3b853 100644 --- a/cpp/bindings/qpid/python/python.i +++ b/cpp/bindings/qpid/python/python.i @@ -132,7 +132,10 @@ static PyObject* pTransportFailure; # equivalent in C++, so we will translate them to sasl_mechanism # when possible. def __init__(self, url=None, **options): - args = [url] if url else [] + if url: + args = [url] + else: + args = [] if options : if "sasl_mechanisms" in options : if ' ' in options.get("sasl_mechanisms",'') : @@ -196,7 +199,7 @@ static PyObject* pTransportFailure; self._acknowledge_all(sync) __swig_getmethods__["connection"] = getConnection - if _newclass: connection = _swig_property(getConnection) + if _newclass: connection = property(getConnection) %} } @@ -205,10 +208,10 @@ static PyObject* pTransportFailure; %pythoncode %{ __swig_getmethods__["capacity"] = getCapacity __swig_setmethods__["capacity"] = setCapacity - if _newclass: capacity = _swig_property(getCapacity, setCapacity) + if _newclass: capacity = property(getCapacity, setCapacity) __swig_getmethods__["session"] = getSession - if _newclass: session = _swig_property(getSession) + if _newclass: session = property(getSession) %} %pythoncode %{ @@ -233,10 +236,10 @@ static PyObject* pTransportFailure; __swig_getmethods__["capacity"] = getCapacity __swig_setmethods__["capacity"] = setCapacity - if _newclass: capacity = _swig_property(getCapacity, setCapacity) + if _newclass: capacity = property(getCapacity, setCapacity) __swig_getmethods__["session"] = getSession - if _newclass: session = _swig_property(getSession) + if _newclass: session = property(getSession) %} } @@ -298,24 +301,23 @@ static PyObject* pTransportFailure; self.setContent(content) __swig_getmethods__["content"] = _get_content __swig_setmethods__["content"] = _set_content - if _newclass: content = _swig_property(_get_content, _set_content) + if _newclass: content = property(_get_content, _set_content) __swig_getmethods__["content_type"] = getContentType __swig_setmethods__["content_type"] = setContentType - if _newclass: content_type = _swig_property(getContentType, - setContentType) + if _newclass: content_type = property(getContentType, setContentType) __swig_getmethods__["id"] = getMessageId __swig_setmethods__["id"] = setMessageId - if _newclass: id = _swig_property(getMessageId, setMessageId) + if _newclass: id = property(getMessageId, setMessageId) __swig_getmethods__["subject"] = getSubject __swig_setmethods__["subject"] = setSubject - if _newclass: subject = _swig_property(getSubject, setSubject) + if _newclass: subject = property(getSubject, setSubject) __swig_getmethods__["priority"] = getPriority __swig_setmethods__["priority"] = setPriority - if _newclass: priority = _swig_property(getPriority, setPriority) + if _newclass: priority = property(getPriority, setPriority) def getTtl(self) : return self._getTtl().getMilliseconds()/1000.0 @@ -323,28 +325,26 @@ static PyObject* pTransportFailure; self._setTtl(Duration(int(1000*duration))) __swig_getmethods__["ttl"] = getTtl __swig_setmethods__["ttl"] = setTtl - if _newclass: ttl = _swig_property(getTtl, setTtl) + if _newclass: ttl = property(getTtl, setTtl) __swig_getmethods__["user_id"] = getUserId __swig_setmethods__["user_id"] = setUserId - if _newclass: user_id = _swig_property(getUserId, setUserId) + if _newclass: user_id = property(getUserId, setUserId) __swig_getmethods__["correlation_id"] = getCorrelationId __swig_setmethods__["correlation_id"] = setCorrelationId - if _newclass: correlation_id = _swig_property(getCorrelationId, - setCorrelationId) + if _newclass: correlation_id = property(getCorrelationId, setCorrelationId) __swig_getmethods__["redelivered"] = getRedelivered __swig_setmethods__["redelivered"] = setRedelivered - if _newclass: redelivered = _swig_property(getRedelivered, - setRedelivered) + if _newclass: redelivered = property(getRedelivered, setRedelivered) __swig_getmethods__["durable"] = getDurable __swig_setmethods__["durable"] = setDurable - if _newclass: durable = _swig_property(getDurable, setDurable) + if _newclass: durable = property(getDurable, setDurable) __swig_getmethods__["properties"] = getProperties - if _newclass: properties = _swig_property(getProperties) + if _newclass: properties = property(getProperties) def getReplyTo(self) : return self._getReplyTo().str() @@ -352,7 +352,7 @@ static PyObject* pTransportFailure; self._setReplyTo(Address(address_str)) __swig_getmethods__["reply_to"] = getReplyTo __swig_setmethods__["reply_to"] = setReplyTo - if _newclass: reply_to = _swig_property(getReplyTo, setReplyTo) + if _newclass: reply_to = property(getReplyTo, setReplyTo) def __repr__(self): args = [] diff --git a/cpp/bindings/qpid/ruby/README.rdoc b/cpp/bindings/qpid/ruby/README.rdoc index 0ae7e5cbed..478fc939d9 100644 --- a/cpp/bindings/qpid/ruby/README.rdoc +++ b/cpp/bindings/qpid/ruby/README.rdoc @@ -2,7 +2,7 @@ Qpid is an cross-platform enterprise messaging system. -Version :: 0.10.0.alpha.0 +Version :: 0.17.0 = Links diff --git a/cpp/bindings/qpid/ruby/Rakefile b/cpp/bindings/qpid/ruby/Rakefile index df0b3970b6..99c3e13c83 100644 --- a/cpp/bindings/qpid/ruby/Rakefile +++ b/cpp/bindings/qpid/ruby/Rakefile @@ -120,7 +120,9 @@ spec = Gem::Specification.new do |s| "lib/**/*.rb", "test/**/*.rb", "examples/**/*.rb", - "ext/**/*"] + "ext/**/*", + "features/**/*", + "spec/**/*"] end Gem::PackageTask.new(spec) do |pkg| diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb index e5071ca4e6..845cc2b116 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb @@ -1,3 +1,22 @@ +# +# 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. +# + Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)"$/ do |name, subject, key, value| options = Hash.new options["#{key}"] = "#{value}" diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb index b4146ac1fb..3fe3e6941f 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/connection_steps.rb @@ -1,3 +1,22 @@ +# +# 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. +# + # close all connections After do @connection.close if @connection diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb index 8157fb7735..a8c8aa4a43 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/receiver_steps.rb @@ -1,3 +1,22 @@ +# +# 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. +# + Given /^an existing receiver for "([^"]*)"$/ do |address| steps %Q{ Given an open session diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb index 3ff081c7d2..93dbd2d5c0 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/sender_steps.rb @@ -1,3 +1,22 @@ +# +# 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. +# + Given /^the message "([^"]*)" is sent$/ do |content| @sender.send Qpid::Messaging::Message.new :content => "#{content}" end diff --git a/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb b/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb index f97e423ee9..cf775d917d 100644 --- a/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb +++ b/cpp/bindings/qpid/ruby/features/step_definitions/session_steps.rb @@ -1,3 +1,22 @@ +# +# 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. +# + Given /^a closed session/ do steps %Q{ Given an open connection diff --git a/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb b/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb index 7b9130156d..2f20fab18e 100644 --- a/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb +++ b/cpp/bindings/qpid/ruby/lib/qpid/encoding.rb @@ -45,8 +45,10 @@ module Qpid content_type = message.content_type unless content_type case content_type - when "amqp/map": Cqpid.decodeMap message.message_impl - when "amqp/list": Cqpid.decodeList message.message_impl + when "amqp/map" + Cqpid.decodeMap message.message_impl + when "amqp/list" + Cqpid.decodeList message.message_impl end message.content diff --git a/cpp/bindings/qpid/ruby/lib/qpid/version.rb b/cpp/bindings/qpid/ruby/lib/qpid/version.rb index f387ba98dc..39524e428f 100644 --- a/cpp/bindings/qpid/ruby/lib/qpid/version.rb +++ b/cpp/bindings/qpid/ruby/lib/qpid/version.rb @@ -22,7 +22,7 @@ module Qpid module Version NUMBERS = [MAJOR = 0, - MINOR = 13, + MINOR = 17, BUILD = 0] end diff --git a/cpp/bindings/swig_python_typemaps.i b/cpp/bindings/swig_python_typemaps.i index e99ce65254..25a4e46b18 100644 --- a/cpp/bindings/swig_python_typemaps.i +++ b/cpp/bindings/swig_python_typemaps.i @@ -25,7 +25,11 @@ static PyObject* pUuidModule; %} %init %{ - pUuidModule = PyImport_ImportModule("uuid"); + /* Instead of directly referencing the uuid module (which is not available + * on older versions of Python), reference the wrapper defined in + * qpid.datatypes. + */ + pUuidModule = PyImport_ImportModule("qpid.datatypes"); /* Although it is not required, we'll publish the uuid module in our * module, as if this module was a python module and we called diff --git a/cpp/configure.ac b/cpp/configure.ac index 8729ace169..c68fed932e 100644 --- a/cpp/configure.ac +++ b/cpp/configure.ac @@ -27,7 +27,7 @@ AC_PROG_CC_STDC AM_PROG_CC_C_O AC_PROG_CXX AC_USE_SYSTEM_EXTENSIONS -AC_LANG([C++]) +AC_LANG([C++]) # Check for optional use of help2man AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) @@ -83,14 +83,14 @@ if test x$GXX = xyes; then gl_COMPILER_FLAGS(-Wvolatile-register-var) gl_COMPILER_FLAGS(-Winvalid-pch) gl_COMPILER_FLAGS(-Wno-system-headers) - gl_COMPILER_FLAGS(-Woverloaded-virtual) + gl_COMPILER_FLAGS(-Woverloaded-virtual) AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS]) AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.]) COMPILER_FLAGS= fi else AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no]) - + # Set up for sun CC compiler if test x$SUNCC = xyes; then if test "${enableval}" = yes; then @@ -118,7 +118,7 @@ LIBS=$gl_saved_libs gl_CLOCK_TIME -# Enable Valgrind +# Enable Valgrind AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--enable-valgrind], [run valgrind memory checker on tests, if available (default yes)])], @@ -203,13 +203,26 @@ AM_CONDITIONAL([HAVE_RUBY_DEVEL], [test -f $RUBY_INC/ruby.h && test -n "$SWIG"]) # Python bindings: To build python wrappers, the python-devel files must be present. AM_PATH_PYTHON() AS_IF([test -n "$PYTHON"], [ - PKG_CHECK_MODULES([PYTHON], [python], [have_python_dev=yes],[ + PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION], [have_python_dev=yes],[ + # We didn't find pkg-config information for python-2.7 this + # may mean we have an earlier python version: + # Try to find the include and library files directly in the default + # location + AC_MSG_WARN([Didn't find Python 2.7 developer libs - looking for older version]) + PYTHON_INC=$($PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()') + AC_CHECK_LIB([python$PYTHON_VERSION],[Py_Initialize]) + AC_CHECK_FILE(["$PYTHON_INC/Python.h"],[ + PYTHON_CFLAGS="-I$PYTHON_INC" + PYTHON_LIBS="-lpython$PYTHON_VERSION" + have_python_dev=yes + ],[ if test yes = "$with_python" ; then AC_MSG_ERROR([Couldn't find Python developer libs - you probably need to install a python-dev or python-devel package]) else AC_MSG_WARN([Couldn't find Python developer libs - you probably don't have a python-dev or python-devel package installed]) fi ]) + ]) AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_LIBS) ]) @@ -249,7 +262,7 @@ tmp_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync" AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],) AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],) -AC_ARG_WITH([cpg], +AC_ARG_WITH([cpg], [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])], [case "${withval}" in yes) # yes - require dependencies @@ -257,7 +270,7 @@ AC_ARG_WITH([cpg], test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel]) with_cpg=yes ;; - no) with_cpg=no ;; + no) with_cpg=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;; esac], [ # not specified - use if present @@ -265,12 +278,14 @@ AC_ARG_WITH([cpg], ] ) AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes]) +AC_SUBST(USE_CPG, [$with_cpg]) + # Clean up unnceccassary flags if we don't use clustering AS_IF([test ! x$with_cpg = xyes], [LDFLAGS=$tmp_LDFLAGS]) AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,) AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,) -AC_ARG_WITH([libcman], +AC_ARG_WITH([libcman], [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])], [case "${withval}" in yes) # yes - require dependencies @@ -278,7 +293,7 @@ AC_ARG_WITH([libcman], test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel]) with_libcman=yes ;; - no) with_libcman=no ;; + no) with_libcman=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;; esac], [ # not specified - use if present and we're using with_cpg @@ -430,9 +445,9 @@ AC_ARG_WITH([ssl], [ with_SSL=yes AC_PATH_PROG([NSPR_CONFIG], [nspr-config]) - AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no], + AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no], [AC_PATH_PROG([NSS_CONFIG], [nss-config]) - AS_IF([test x$NSS_CONFIG = x], [with_SSL=no], + AS_IF([test x$NSS_CONFIG = x], [with_SSL=no], [SSL_CFLAGS="`$NSPR_CONFIG --cflags` `$NSS_CONFIG --cflags`" SSL_LDFLAGS="`$NSPR_CONFIG --libs` `$NSS_CONFIG --libs`"])]) ] @@ -448,7 +463,7 @@ AC_ARG_WITH([poller], [AS_HELP_STRING([--with-poller], [The low level poller implementation: poll/solaris-ecf/epoll])], [case ${withval} in poll) - AC_CHECK_HEADERS([sys/poll.h],[poller=no],[AC_MSG_ERROR([Can't find poll.h header file for poll])]) + AC_CHECK_HEADERS([sys/poll.h],[poller=poll],[AC_MSG_ERROR([Can't find poll.h header file for poll])]) ;; solaris-ecf) AC_CHECK_HEADERS([port.h],[poller=solaris-ecf],[AC_MSG_ERROR([Can't find port.h header file for solaris-ecf])]) @@ -458,14 +473,17 @@ AC_ARG_WITH([poller], ;; esac], [ - AC_CHECK_HEADERS([sys/poll.h],[poller=no],) - AC_CHECK_HEADERS([port.h],[poller=solaris-ecf],) + # We check for poll first so that it is overridden + AC_CHECK_HEADERS([sys/poll.h],[poller=poll],) + # Not currently supported - WIP + #AC_CHECK_HEADERS([port.h],[poller=solaris-ecf],) AC_CHECK_HEADERS([sys/epoll.h],[poller=epoll],) ] ) -AM_CONDITIONAL([HAVE_ECF], [test x$poller = xsolaris-ecf]) -AM_CONDITIONAL([HAVE_EPOLL], [test x$poller = xepoll]) +AM_CONDITIONAL([USE_ECF], [test x$poller = xsolaris-ecf]) +AM_CONDITIONAL([USE_POLL], [test x$poller = xpoll]) +AM_CONDITIONAL([USE_EPOLL], [test x$poller = xepoll]) #Filter not implemented or invalid mechanisms if test $poller = xno; then @@ -480,12 +498,30 @@ case "$host" in esac AM_CONDITIONAL([SUNOS], [test x$arch = xsolaris]) +# Check whether we've got the header for dtrace static probes +AC_ARG_WITH([probes], + [AS_HELP_STRING([--with-probes], [Build with dtrace/systemtap static probes])], + [case ${withval} in + yes) + AC_CHECK_HEADERS([sys/sdt.h]) + ;; + no) + ;; + *) + AC_MSG_ERROR([Bad value for --with-probes: ${withval}]) + ;; + esac], + [ + AC_CHECK_HEADERS([sys/sdt.h]) + ] +) + # Check for some syslog capabilities not present in all systems -AC_TRY_COMPILE([#include ], +AC_TRY_COMPILE([#include ], [int v = LOG_AUTHPRIV;], [AC_DEFINE([HAVE_LOG_AUTHPRIV], [1], [Set to 1 whether LOG_AUTHPRIV is supported.])],) -AC_TRY_COMPILE([#include ], +AC_TRY_COMPILE([#include ], [int v = LOG_FTP;], [AC_DEFINE([HAVE_LOG_FTP], [1], [Set to 1 whether LOG_FTP is supported.])],) @@ -503,8 +539,6 @@ AC_CHECK_LIB([nsl],[getipnodebyname],[NSL_LIB="-lnsl"],[NSL_LIB=""],[]) SOCKLIBS="$SOCKET_LIB $NSL_LIB" AC_SUBST([SOCKLIBS]) -AM_PATH_PYTHON() - # Used by env scripts to find libraries in cmake or autoconf builds. builddir_lib_suffix="/.libs" AC_SUBST([builddir_lib_suffix]) @@ -539,6 +573,7 @@ AC_CONFIG_FILES([ managementgen/Makefile etc/Makefile src/Makefile + src/tests/cpg_check.sh src/tests/Makefile src/tests/test_env.sh src/tests/install_env.sh diff --git a/cpp/design_docs/new-ha-design.txt b/cpp/design_docs/new-ha-design.txt index 3272b1315f..acca1720b4 100644 --- a/cpp/design_docs/new-ha-design.txt +++ b/cpp/design_docs/new-ha-design.txt @@ -257,20 +257,24 @@ Broker startup with store: - When connecting as backup, check UUID matches primary, shut down if not. - Empty: start ok, no UUID check with primary. -** Current Limitations +* Current Limitations (In no particular order at present) For message replication: -LM1 - The re-synchronisation does not handle the case where a newly elected -primary is *behind* one of the other backups. To address this I propose -a new event for restting the sequence that the new primary would send -out on detecting that a replicating browser is ahead of it, requesting -that the replica revert back to a particular sequence number. The -replica on receiving this event would then discard (i.e. dequeue) all -the messages ahead of that sequence number and reset the counter to -correctly sequence any subsequently delivered messages. +LM1a - On failover, backups delete their queues and download the full queue state from the +primary. There was code to use messags already on the backup for re-synchronisation, it +was removed in early development (r1214490) to simplify the logic while getting basic +replication working. It needs to be re-introduced. + +LM1b - This re-synchronisation does not handle the case where a newly elected primary is *behind* +one of the other backups. To address this I propose a new event for restting the sequence +that the new primary would send out on detecting that a replicating browser is ahead of +it, requesting that the replica revert back to a particular sequence number. The replica +on receiving this event would then discard (i.e. dequeue) all the messages ahead of that +sequence number and reset the counter to correctly sequence any subsequently delivered +messages. LM2 - There is a need to handle wrap-around of the message sequence to avoid confusing the resynchronisation where a replica has been disconnected @@ -288,12 +292,12 @@ confirmed to the publisher before they are replicated, leaving them vulnerable to a loss of the new primary before they are replicated. LM6 - persistence: In the event of a total cluster failure there are -no tools to automatically identify the "latest" store. Once this -is manually identfied, all other stores belonging to cluster members -must be erased and the latest node must started as primary. +no tools to automatically identify the "latest" store. -LM6 - persistence: In the event of a single node failure, that nodes -store must be erased before it can re-join the cluster. +LM7 - persistence: In the event of a persistent broker being +re-started (due to failure or admin) it should be able to use its +stored messages to reduce the download required from the +primary. This means storing message IDs persistently. For configuration propagation: @@ -349,6 +353,12 @@ LC6 - The events and query responses are not fully synchronized. It is not possible to miss a create event and yet not to have the object in question in the query response however. +LC7 Federated links from the primary will be lost in failover, they will not be re-connected on +the new primary. Federation links to the primary can fail over. + +LC8 Only plain FIFO queues can be replicated. LVQs and ring queues are not yet supported. + +LC9 The "last man standing" feature of the old cluster is not available. * Benefits compared to previous cluster implementation. @@ -359,58 +369,3 @@ LC6 - The events and query responses are not fully synchronized. - Can take advantage of resource manager features, e.g. virtual IP addresses. - Fewer inconsistent errors (store failures) that can be handled without killing brokers. - Improved performance -* User Documentation Notes - -Notes to seed initial user documentation. Loosely tracking the implementation, -some points mentioned in the doc may not be implemented yet. - -** High Availability Overview - -HA is implemented using a 'hot standby' approach. Clients are directed -to a single "primary" broker. The primary executes client requests and -also replicates them to one or more "backup" brokers. If the primary -fails, one of the backups takes over the role of primary carrying on -from where the primary left off. Clients will fail over to the new -primary automatically and continue their work. - -TODO: at least once, deduplication. - -** Enabling replication on the client. - -To enable replication set the qpid.replicate argument when creating a -queue or exchange. - -This can have one of 3 values -- none: the object is not replicated -- configuration: queues, exchanges and bindings are replicated but messages are not. -- messages: configuration and messages are replicated. - -TODO: examples -TODO: more options for default value of qpid.replicate - -A HA client connection has multiple addresses, one for each broker. If -the it fails to connect to an address, or the connection breaks, -it will automatically fail-over to another address. - -Only the primary broker accepts connections, the backup brokers -redirect connection attempts to the primary. If the primary fails, one -of the backups is promoted to primary and clients fail-over to the new -primary. - -TODO: using multiple-address connections, examples c++, python, java. - -TODO: dynamic cluster addressing? - -TODO: need de-duplication. - -** Enabling replication on the broker. - -Network topology: backup links, separate client/broker networks. -Describe failover mechanisms. -- Client view: URLs, failover, exclusion & discovery. -- Broker view: similar. -Role of rmganager - -** Configuring rgmanager - -** Configuring qpidd diff --git a/cpp/etc/Makefile.am b/cpp/etc/Makefile.am index 1e4db561a7..b154a105d4 100644 --- a/cpp/etc/Makefile.am +++ b/cpp/etc/Makefile.am @@ -20,9 +20,10 @@ SASL_CONF = sasl2/qpidd.conf EXTRA_DIST = \ $(SASL_CONF) \ - qpidd qpidd.conf qpidc.conf CMakeLists.txt + qpidd qpidd-primary qpidd.conf qpidc.conf CMakeLists.txt \ + cluster.conf-example.xml -confdir=$(sysconfdir)/qpid +confdir = $(sysconfdir)/qpid nobase_conf_DATA=\ qpidc.conf @@ -32,5 +33,23 @@ nobase_sysconf_DATA = \ if HAVE_SASL nobase_sysconf_DATA += \ $(SASL_CONF) - endif + +# Substitute values for directories in init scripts. +# +# We can't use autoconf substitution directly because it leaves +# ${prefix} and ${exec_prefix} unexpanded. Substitute with sed +# scripts. +SUBST="s|!!sysconfdir!!|${sysconfdir}|;s|!!sbindir!!|${sbindir}|;s|!!bindir!!|${bindir}|" +qpidd: qpidd.in + sed $(SUBST) $< > $@ +qpidd-primary: qpidd-primary.in + sed $(SUBST) $< > $@ +cluster.conf-example.xml: cluster.conf-example.xml.in + sed $(SUBST) $< > $@ + +CLEANFILES = qpidd qpidd-primary cluster.conf-example.xml + +initddir = $(sysconfdir)/init.d +nobase_initd_SCRIPTS = qpidd qpidd-primary + diff --git a/cpp/etc/cluster.conf-example.xml.in b/cpp/etc/cluster.conf-example.xml.in new file mode 100644 index 0000000000..14b961a363 --- /dev/null +++ b/cpp/etc/cluster.conf-example.xml.in @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +