You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2009/03/06 15:10:36 UTC
svn commit: r750910 - in /qpid/trunk/qpid/cpp/src:
qpid/cluster/ConnectionCodec.cpp qpid/cluster/UpdateClient.cpp
tests/federated_cluster_test
Author: gsim
Date: Fri Mar 6 14:10:35 2009
New Revision: 750910
URL: http://svn.apache.org/viewvc?rev=750910&view=rev
Log:
QPID-1719: Ensure management object id remain in sync across cluster.
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
qpid/trunk/qpid/cpp/src/tests/federated_cluster_test
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp?rev=750910&r1=750909&r2=750910&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp Fri Mar 6 14:10:35 2009
@@ -44,7 +44,7 @@
return 0;
}
-// Used for outgoing Link connections, we don't care.
+// Used for outgoing Link connections
sys::ConnectionCodec*
ConnectionCodec::Factory::create(sys::OutputControl& out, const std::string& logId) {
return new ConnectionCodec(out, logId, cluster, false, true);
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp?rev=750910&r1=750909&r2=750910&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Fri Mar 6 14:10:35 2009
@@ -98,7 +98,7 @@
done(ok), failed(fail), connectionSettings(cs)
{
connection.open(url, cs);
- session = connection.newSession("update_shared");
+ session = connection.newSession(UPDATE);
}
UpdateClient::~UpdateClient() {}
Modified: qpid/trunk/qpid/cpp/src/tests/federated_cluster_test
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/federated_cluster_test?rev=750910&r1=750909&r2=750910&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/federated_cluster_test (original)
+++ qpid/trunk/qpid/cpp/src/tests/federated_cluster_test Fri Mar 6 14:10:35 2009
@@ -37,9 +37,14 @@
unset BROKER_A
fi
if [[ $NODE_1 ]] ; then
- $srcdir/stop_cluster
+ ../qpidd -q --port $NODE_1
unset NODE_1
fi
+ if [[ $NODE_2 ]] ; then
+ ../qpidd -q --port $NODE_2
+ unset NODE_2
+ fi
+ rm cluster.ports
}
start_brokers() {
@@ -60,8 +65,8 @@
$PYTHON_DIR/commands/qpid-config -a "localhost:$NODE_1" add exchange direct test-exchange
#create dynamic routes for test exchange
- $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$NODE_1" "localhost:$BROKER_A" test-exchange
- $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$BROKER_A" "localhost:$NODE_1" test-exchange
+ $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$NODE_2" "localhost:$BROKER_A" test-exchange
+ $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$BROKER_A" "localhost:$NODE_2" test-exchange
#create test queue on cluster and bind it to the test exchange
$PYTHON_DIR/commands/qpid-config -a "localhost:$NODE_1" add queue test-queue
@@ -72,7 +77,7 @@
$PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_A" bind test-exchange test-queue from-cluster
}
-run_test_pull_to_cluster() {
+run_test_pull_to_cluster_two_consumers() {
#start consumers on each of the two nodes of the cluster
./receiver --port $NODE_1 --queue test-queue --credit-window 1 > fed1.out.tmp &
./receiver --port $NODE_2 --queue test-queue --credit-window 1 > fed2.out.tmp &
@@ -89,6 +94,20 @@
rm -f fed*.tmp #cleanup
}
+run_test_pull_to_cluster() {
+ #send stream of messages to test exchange on single broker
+ for i in `seq 1 1000`; do echo Message $i >> fed.in.tmp; done
+ ./sender --port $BROKER_A --exchange test-exchange --routing-key to-cluster --send-eos 1 < fed.in.tmp
+
+ #consume from remaining node of the cluster
+ ./receiver --port $NODE_2 --queue test-queue > fed.out.tmp
+
+ #verify all messages are received
+ diff fed.in.tmp fed.out.tmp || fail "federated link to cluster failed: expectations not met!"
+
+ rm -f fed*.tmp #cleanup
+}
+
run_test_pull_from_cluster() {
#start consumer on single broker
./receiver --port $BROKER_A --queue test-queue --credit-window 1 > fed.out.tmp &
@@ -125,8 +144,19 @@
echo "brokers started"
setup
echo "setup completed"
- run_test_pull_to_cluster
+ run_test_pull_to_cluster_two_consumers
echo "federated link to cluster verified"
run_test_pull_from_cluster
echo "federated link from cluster verified"
+ if [[ $TEST_NODE_FAILURE ]] ; then
+ #kill first cluster node and retest
+ kill -9 $(../qpidd --check --port $NODE_1) && unset NODE_1
+ echo "killed first cluster node; waiting for links to re-establish themselves..."
+ sleep 5
+ echo "retesting..."
+ run_test_pull_to_cluster
+ echo "federated link to cluster verified"
+ run_test_pull_from_cluster
+ echo "federated link from cluster verified"
+ fi
fi
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org