Author: ataylor
Date: 2012-02-17 10:31:33 -0500 (Fri, 17 Feb 2012)
New Revision: 12137
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/config/ClusterConnectionConfiguration.java
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java
trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml
trunk/hornetq-jms/src/main/resources/schema/hornetq-jms.xsd
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
Log:
HORNETQ-853 - add callFailoverTimeout to cluster connection
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/config/ClusterConnectionConfiguration.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/config/ClusterConnectionConfiguration.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/config/ClusterConnectionConfiguration.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -48,6 +48,8 @@
private final long callTimeout;
+ private final long callFailoverTimeout;
+
private final boolean duplicateDetection;
private final boolean forwardWhenNoConsumers;
@@ -86,6 +88,7 @@
ConfigurationImpl.DEFAULT_CLUSTER_MAX_RETRY_INTERVAL,
ConfigurationImpl.DEFAULT_CLUSTER_RECONNECT_ATTEMPTS,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
duplicateDetection,
forwardWhenNoConsumers,
maxHops,
@@ -106,6 +109,7 @@
final long maxRetryInterval,
final int reconnectAttempts,
final long callTimeout,
+ final long callFAiloverTimeout,
final boolean duplicateDetection,
final boolean forwardWhenNoConsumers,
final int maxHops,
@@ -125,6 +129,7 @@
this.staticConnectors = staticConnectors;
this.duplicateDetection = duplicateDetection;
this.callTimeout = callTimeout;
+ this.callFailoverTimeout = callFAiloverTimeout;
this.forwardWhenNoConsumers = forwardWhenNoConsumers;
discoveryGroupName = null;
this.maxHops = maxHops;
@@ -155,6 +160,7 @@
ConfigurationImpl.DEFAULT_CLUSTER_MAX_RETRY_INTERVAL,
ConfigurationImpl.DEFAULT_CLUSTER_RECONNECT_ATTEMPTS,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
duplicateDetection,
forwardWhenNoConsumers,
maxHops,
@@ -174,6 +180,7 @@
final long maxRetryInterval,
final int reconnectAttempts,
final long callTimeout,
+ final long callFAiloverTimeout,
final boolean duplicateDetection,
final boolean forwardWhenNoConsumers,
final int maxHops,
@@ -190,6 +197,7 @@
this.maxRetryInterval = maxRetryInterval;
this.reconnectAttempts = reconnectAttempts;
this.callTimeout = callTimeout;
+ this.callFailoverTimeout = callFAiloverTimeout;
this.duplicateDetection = duplicateDetection;
this.forwardWhenNoConsumers = forwardWhenNoConsumers;
this.discoveryGroupName = discoveryGroupName;
@@ -254,7 +262,12 @@
{
return callTimeout;
}
-
+
+ public long getCallFailoverTimeout()
+ {
+ return callFailoverTimeout;
+ }
+
public String getConnectorName()
{
return connectorName;
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -1024,6 +1024,8 @@
Validators.GT_ZERO);
long callTimeout = XMLConfigurationUtil.getLong(e, "call-timeout",
HornetQClient.DEFAULT_CALL_TIMEOUT, Validators.GT_ZERO);
+
+ long callFailoverTimeout = XMLConfigurationUtil.getLong(e,
"call-failover-timeout", HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
Validators.MINUS_ONE_OR_GT_ZERO);
double retryIntervalMultiplier = XMLConfigurationUtil.getDouble(e,
"retry-interval-multiplier",
ConfigurationImpl.DEFAULT_CLUSTER_RETRY_INTERVAL_MULTIPLIER, Validators.GT_ZERO);
@@ -1082,6 +1084,7 @@
maxRetryInterval,
reconnectAttempts,
callTimeout,
+ callFailoverTimeout,
duplicateDetection,
forwardWhenNoConsumers,
maxHops,
@@ -1102,6 +1105,7 @@
maxRetryInterval,
reconnectAttempts,
callTimeout,
+ callFailoverTimeout,
duplicateDetection,
forwardWhenNoConsumers,
maxHops,
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -104,6 +104,8 @@
private final long callTimeout;
+ private final long callFailoverTimeout;
+
private final double retryIntervalMultiplier;
private final long maxRetryInterval;
@@ -168,6 +170,7 @@
final long maxRetryInterval,
final int reconnectAttempts,
final long callTimeout,
+ final long callFailoverTimeout,
final boolean useDuplicateDetection,
final boolean routeWhenNoConsumers,
final int confirmationWindowSize,
@@ -242,6 +245,8 @@
this.manager = manager;
this.callTimeout = callTimeout;
+
+ this.callFailoverTimeout = callFailoverTimeout;
this.minLargeMessageSize = minLargeMessageSize;
@@ -280,6 +285,7 @@
final long maxRetryInterval,
final int reconnectAttempts,
final long callTimeout,
+ final long callFailoverTimeout,
final boolean useDuplicateDetection,
final boolean routeWhenNoConsumers,
final int confirmationWindowSize,
@@ -325,6 +331,8 @@
this.callTimeout = callTimeout;
+ this.callFailoverTimeout = callFailoverTimeout;
+
this.useDuplicateDetection = useDuplicateDetection;
this.routeWhenNoConsumers = routeWhenNoConsumers;
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -669,6 +669,7 @@
config.getMaxRetryInterval(),
config.getReconnectAttempts(),
config.getCallTimeout(),
+ config.getCallFailoverTimeout(),
config.isDuplicateDetection(),
config.isForwardWhenNoConsumers(),
config.getConfirmationWindowSize(),
@@ -707,6 +708,7 @@
config.getMaxRetryInterval(),
config.getReconnectAttempts(),
config.getCallTimeout(),
+ config.getCallFailoverTimeout(),
config.isDuplicateDetection(),
config.isForwardWhenNoConsumers(),
config.getConfirmationWindowSize(),
Modified:
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java
===================================================================
---
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -236,6 +236,7 @@
Assert.assertEquals(false, ccc.isForwardWhenNoConsumers());
Assert.assertEquals(1, ccc.getMaxHops());
Assert.assertEquals(123, ccc.getCallTimeout());
+ Assert.assertEquals(123, ccc.getCallFailoverTimeout());
Assert.assertEquals("connector1",
ccc.getStaticConnectors().get(0));
Assert.assertEquals("connector2",
ccc.getStaticConnectors().get(1));
Assert.assertEquals(null, ccc.getDiscoveryGroupName());
@@ -246,6 +247,7 @@
Assert.assertEquals("queues2", ccc.getAddress());
Assert.assertEquals(4, ccc.getRetryInterval());
Assert.assertEquals(456, ccc.getCallTimeout());
+ Assert.assertEquals(456, ccc.getCallFailoverTimeout());
Assert.assertEquals(false, ccc.isDuplicateDetection());
Assert.assertEquals(true, ccc.isForwardWhenNoConsumers());
Assert.assertEquals(2, ccc.getMaxHops());
Modified: trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml
===================================================================
--- trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml 2012-02-17
15:03:28 UTC (rev 12136)
+++ trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml 2012-02-17
15:31:33 UTC (rev 12137)
@@ -174,6 +174,7 @@
<forward-when-no-consumers>false</forward-when-no-consumers>
<max-hops>1</max-hops>
<call-timeout>123</call-timeout>
+ <call-failover-timeout>123</call-failover-timeout>
<static-connectors>
<connector-ref>connector1</connector-ref>
<connector-ref>connector2</connector-ref>
@@ -187,6 +188,7 @@
<forward-when-no-consumers>true</forward-when-no-consumers>
<max-hops>2</max-hops>
<call-timeout>456</call-timeout>
+ <call-failover-timeout>456</call-failover-timeout>
<discovery-group-ref discovery-group-name="dg1"/>
</cluster-connection>
</cluster-connections>
Modified: trunk/hornetq-jms/src/main/resources/schema/hornetq-jms.xsd
===================================================================
--- trunk/hornetq-jms/src/main/resources/schema/hornetq-jms.xsd 2012-02-17 15:03:28 UTC
(rev 12136)
+++ trunk/hornetq-jms/src/main/resources/schema/hornetq-jms.xsd 2012-02-17 15:31:33 UTC
(rev 12137)
@@ -58,6 +58,9 @@
<xsd:element name="call-timeout" type="xsd:long"
maxOccurs="1" minOccurs="0">
</xsd:element>
+ <xsd:element name="call-failover-timeout" type="xsd:long"
+ maxOccurs="1" minOccurs="0">
+ </xsd:element>
<xsd:element name="consumer-window-size"
type="xsd:int"
maxOccurs="1" minOccurs="0">
</xsd:element>
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -1906,7 +1906,7 @@
retryInterval,
ConfigurationImpl.DEFAULT_CLUSTER_RETRY_INTERVAL_MULTIPLIER,
ConfigurationImpl.DEFAULT_CLUSTER_MAX_RETRY_INTERVAL,
- reconnectAttempts, 1000, true, forwardWhenNoConsumers, maxHops,
+ reconnectAttempts, 1000, 1000, true, forwardWhenNoConsumers, maxHops,
1024, pairs, false);
serverFrom.getConfiguration().getClusterConfigurations().add(clusterConf);
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2012-02-17
15:03:28 UTC (rev 12136)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/HornetQConnectionFactoryTest.java 2012-02-17
15:31:33 UTC (rev 12137)
@@ -68,6 +68,7 @@
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
HornetQClient.DEFAULT_CONNECTION_TTL,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
@@ -123,6 +124,7 @@
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
HornetQClient.DEFAULT_CONNECTION_TTL,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
@@ -164,6 +166,7 @@
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
HornetQClient.DEFAULT_CONNECTION_TTL,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
@@ -203,6 +206,7 @@
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
HornetQClient.DEFAULT_CONNECTION_TTL,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
@@ -243,6 +247,7 @@
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
HornetQClient.DEFAULT_CONNECTION_TTL,
HornetQClient.DEFAULT_CALL_TIMEOUT,
+ HornetQClient.DEFAULT_CALL_FAILOVER_TIMEOUT,
HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
@@ -618,6 +623,7 @@
final long clientFailureCheckPeriod,
final long connectionTTL,
final long callTimeout,
+ final long callFailoverTimeout,
final int minLargeMessageSize,
final int consumerWindowSize,
final int consumerMaxRate,
@@ -657,6 +663,7 @@
Assert.assertEquals(cf.getClientFailureCheckPeriod(), clientFailureCheckPeriod);
Assert.assertEquals(cf.getConnectionTTL(), connectionTTL);
Assert.assertEquals(cf.getCallTimeout(), callTimeout);
+ Assert.assertEquals(cf.getCallFailoverTimeout(), callFailoverTimeout);
Assert.assertEquals(cf.getMinLargeMessageSize(), minLargeMessageSize);
Assert.assertEquals(cf.getConsumerWindowSize(), consumerWindowSize);
Assert.assertEquals(cf.getConsumerMaxRate(), consumerMaxRate);