Use a more obvious option prefixing scheme for the various component options set via URI query string.
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/da7cfccf Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/da7cfccf Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/da7cfccf Branch: refs/heads/master Commit: da7cfccfcade4def4c62ea5f18a3dd0ab45ae5e8 Parents: 746877a Author: Timothy Bish <[email protected]> Authored: Mon Feb 2 15:57:04 2015 -0500 Committer: Timothy Bish <[email protected]> Committed: Mon Feb 2 15:57:04 2015 -0500 ---------------------------------------------------------------------- .../jms/provider/amqp/AmqpProviderFactory.java | 2 +- .../provider/failover/FailoverProviderFactory.java | 4 +++- .../qpid/jms/failover/FailoverProviderTest.java | 8 +++++--- .../apache/qpid/jms/failover/JmsFailoverTest.java | 17 +++++++++-------- .../qpid/jms/failover/JmsOfflineBehaviorTests.java | 4 ++-- .../jms/failover/JmsTxConsumerFailoverTest.java | 8 ++++---- .../jms/failover/JmsTxProducerFailoverTest.java | 8 ++++---- 7 files changed, 28 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProviderFactory.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProviderFactory.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProviderFactory.java index 9fa8998..42e6300 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProviderFactory.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProviderFactory.java @@ -36,7 +36,7 @@ public class AmqpProviderFactory extends ProviderFactory { public Provider createProvider(URI remoteURI) throws Exception { Map<String, String> map = PropertyUtil.parseQuery(remoteURI.getQuery()); - Map<String, String> providerOptions = PropertyUtil.filterProperties(map, "provider."); + Map<String, String> providerOptions = PropertyUtil.filterProperties(map, "amqp."); remoteURI = PropertyUtil.replaceQuery(remoteURI, map); http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProviderFactory.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProviderFactory.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProviderFactory.java index 1b02dd9..cc900a6 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProviderFactory.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProviderFactory.java @@ -34,10 +34,12 @@ public class FailoverProviderFactory extends ProviderFactory { public Provider createProvider(URI remoteURI) throws Exception { CompositeData composite = URISupport.parseComposite(remoteURI); Map<String, String> options = composite.getParameters(); + + Map<String, String> filtered = PropertyUtil.filterProperties(options, "failover."); Map<String, String> nested = PropertyUtil.filterProperties(options, "nested."); FailoverProvider provider = new FailoverProvider(composite.getComponents(), nested); - Map<String, String> unused = PropertyUtil.setProperties(provider, options); + Map<String, String> unused = PropertyUtil.setProperties(provider, filtered); if (!unused.isEmpty()) { String msg = "" + " Not all options could be set on the Failover provider." http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/FailoverProviderTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/FailoverProviderTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/FailoverProviderTest.java index 6dd0384..f2863cb 100644 --- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/FailoverProviderTest.java +++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/FailoverProviderTest.java @@ -51,8 +51,10 @@ public class FailoverProviderTest extends AmqpTestSupport { @Test(timeout=60000) public void testFailoverURIConfiguration() throws Exception { URI brokerURI = new URI("failover://(" + getBrokerAmqpConnectionURI() + ")" + - "?maxReconnectDelay=1000&useExponentialBackOff=false" + - "&maxReconnectAttempts=10&startupMaxReconnectAttempts=20"); + "?failover.maxReconnectDelay=1000" + + "&failover.useExponentialBackOff=false" + + "&failover.maxReconnectAttempts=10" + + "&failover.startupMaxReconnectAttempts=20"); Provider asyncProvider = FailoverProviderFactory.create(brokerURI); assertNotNull(asyncProvider); FailoverProvider provider = (FailoverProvider) asyncProvider; @@ -68,7 +70,7 @@ public class FailoverProviderTest extends AmqpTestSupport { @Test(timeout=60000) public void testStartupReconnectAttempts() throws Exception { URI brokerURI = new URI("failover://(amqp://localhost:61616)" + - "?maxReconnectDelay=100&startupMaxReconnectAttempts=5"); + "?failover.maxReconnectDelay=100&failover.startupMaxReconnectAttempts=5"); Provider asyncProvider = FailoverProviderFactory.create(brokerURI); assertNotNull(asyncProvider); FailoverProvider provider = (FailoverProvider) asyncProvider; http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsFailoverTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsFailoverTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsFailoverTest.java index dc9143e..777eac5 100644 --- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsFailoverTest.java +++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsFailoverTest.java @@ -62,7 +62,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testFailoverConnectsWithMultipleURIs() throws Exception { URI brokerURI = new URI("failover://(amqp://127.0.0.1:61616,amqp://localhost:5777," + - getBrokerAmqpConnectionURI() + ")?maxReconnectDelay=500"); + getBrokerAmqpConnectionURI() + ")?failover.maxReconnectDelay=500"); Connection connection = createAmqpConnection(brokerURI); connection.start(); connection.close(); @@ -71,7 +71,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testStartupReconnectAttempts() throws Exception { URI brokerURI = new URI("failover://(amqp://localhost:61616)" + - "?maxReconnectDelay=100&startupMaxReconnectAttempts=5"); + "?failover.maxReconnectDelay=50&failover.startupMaxReconnectAttempts=5"); JmsConnectionFactory factory = new JmsConnectionFactory(brokerURI); Connection connection = factory.createConnection(); try { @@ -88,7 +88,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testStartupReconnectAttemptsMultipleHosts() throws Exception { URI brokerURI = new URI("failover://(amqp://localhost:61616,amqp://localhost:61617)" + - "?maxReconnectDelay=100&startupMaxReconnectAttempts=5"); + "?failover.maxReconnectDelay=100&failover.startupMaxReconnectAttempts=5"); JmsConnectionFactory factory = new JmsConnectionFactory(brokerURI); Connection connection = factory.createConnection(); try { @@ -104,7 +104,8 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testStartFailureWithAsyncExceptionListener() throws Exception { - URI brokerURI = new URI(getAmqpFailoverURI() + "?maxReconnectDelay=100&maxReconnectAttempts=5"); + URI brokerURI = new URI(getAmqpFailoverURI() + + "?failover.maxReconnectDelay=100&failover.maxReconnectAttempts=5"); final CountDownLatch failed = new CountDownLatch(1); JmsConnectionFactory factory = new JmsConnectionFactory(brokerURI); @@ -127,7 +128,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @SuppressWarnings("unused") @Test(timeout=60000) public void testBasicStateRestoration() throws Exception { - URI brokerURI = new URI(getAmqpFailoverURI() + "?maxReconnectDelay=1000"); + URI brokerURI = new URI(getAmqpFailoverURI() + "?failover.maxReconnectDelay=1000"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -157,7 +158,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @SuppressWarnings("unused") @Test(timeout=60000) public void testDurableSubscriberRestores() throws Exception { - URI brokerURI = new URI(getAmqpFailoverURI() + "?maxReconnectDelay=200"); + URI brokerURI = new URI(getAmqpFailoverURI() + "?failover.maxReconnectDelay=200"); connection = createAmqpConnection(brokerURI); connection.setClientID(name.getMethodName()); @@ -199,7 +200,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=90000) public void testBadFirstURIConnectsAndProducerWorks() throws Exception { URI brokerURI = new URI("failover://(amqp://localhost:61616," + - getBrokerAmqpConnectionURI() + ")?maxReconnectDelay=100"); + getBrokerAmqpConnectionURI() + ")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -232,7 +233,7 @@ public class JmsFailoverTest extends AmqpTestSupport { @Test(timeout=90000) public void testNonTxProducerRecoversAfterFailover() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=1000"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=1000"); connection = createAmqpConnection(brokerURI); connection.start(); http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsOfflineBehaviorTests.java ---------------------------------------------------------------------- diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsOfflineBehaviorTests.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsOfflineBehaviorTests.java index 68bc11c..c405de0 100644 --- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsOfflineBehaviorTests.java +++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsOfflineBehaviorTests.java @@ -134,7 +134,7 @@ public class JmsOfflineBehaviorTests extends AmqpTestSupport { startNewBroker(); - URI brokerURI = new URI(getAmqpFailoverURI() + "randomize=false"); + URI brokerURI = new URI(getAmqpFailoverURI() + "failover.randomize=false"); Connection connection = createAmqpConnection(brokerURI); connection.start(); @@ -168,7 +168,7 @@ public class JmsOfflineBehaviorTests extends AmqpTestSupport { @SuppressWarnings("unused") @Test(timeout=60000) public void testClosedReourcesAreNotRestored() throws Exception { - URI brokerURI = new URI(getAmqpFailoverURI() + "?maxReconnectDelay=500"); + URI brokerURI = new URI(getAmqpFailoverURI() + "?failover.maxReconnectDelay=500"); Connection connection = createAmqpConnection(brokerURI); connection.start(); http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxConsumerFailoverTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxConsumerFailoverTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxConsumerFailoverTest.java index f765d6a..027ca92 100644 --- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxConsumerFailoverTest.java +++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxConsumerFailoverTest.java @@ -51,7 +51,7 @@ public class JmsTxConsumerFailoverTest extends AmqpTestSupport { */ @Test(timeout=60000) public void testTxConsumerReceiveAfterFailoverCommits() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -101,7 +101,7 @@ public class JmsTxConsumerFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testTxConsumerReceiveThenFailoverCommitFails() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -138,7 +138,7 @@ public class JmsTxConsumerFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testTxConsumerRollbackAfterFailoverGetsNoErrors() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -182,7 +182,7 @@ public class JmsTxConsumerFailoverTest extends AmqpTestSupport { */ @Test(timeout=60000) public void testTxConsumerReceiveWorksAfterFailoverButCommitFails() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/da7cfccf/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxProducerFailoverTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxProducerFailoverTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxProducerFailoverTest.java index 1028f63..89fed7b 100644 --- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxProducerFailoverTest.java +++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/failover/JmsTxProducerFailoverTest.java @@ -50,7 +50,7 @@ public class JmsTxProducerFailoverTest extends AmqpTestSupport { */ @Test(timeout=60000) public void testTxProducerSendAfterFailoverCommits() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -107,7 +107,7 @@ public class JmsTxProducerFailoverTest extends AmqpTestSupport { */ @Test(timeout=60000) public void testTxProducerSendsThenFailoverCommitFails() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -146,7 +146,7 @@ public class JmsTxProducerFailoverTest extends AmqpTestSupport { @Test(timeout=60000) public void testTxProducerRollbackAfterFailoverGetsNoErrors() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); @@ -189,7 +189,7 @@ public class JmsTxProducerFailoverTest extends AmqpTestSupport { */ @Test(timeout=60000) public void testTxProducerSendWorksButCommitFails() throws Exception { - URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?maxReconnectDelay=100"); + URI brokerURI = new URI("failover://("+ getBrokerAmqpConnectionURI() +")?failover.maxReconnectDelay=100"); connection = createAmqpConnection(brokerURI); connection.start(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
