Author: borges
Date: 2012-02-17 10:39:03 -0500 (Fri, 17 Feb 2012)
New Revision: 12138
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/hornetq-core/src/main/resources/schema/hornetq-configuration.xsd
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java
trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml
Log:
HORNETQ-855 Add missing conf file options present 2.2 and test them.
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:31:33 UTC (rev 12137)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2012-02-17
15:39:03 UTC (rev 12138)
@@ -28,7 +28,13 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.core.config.*;
+import org.hornetq.core.config.BridgeConfiguration;
+import org.hornetq.core.config.BroadcastGroupConfiguration;
+import org.hornetq.core.config.ClusterConnectionConfiguration;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.ConnectorServiceConfiguration;
+import org.hornetq.core.config.CoreQueueConfiguration;
+import org.hornetq.core.config.DivertConfiguration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.config.impl.FileConfiguration;
import org.hornetq.core.config.impl.Validators;
Modified: trunk/hornetq-core/src/main/resources/schema/hornetq-configuration.xsd
===================================================================
--- trunk/hornetq-core/src/main/resources/schema/hornetq-configuration.xsd 2012-02-17
15:31:33 UTC (rev 12137)
+++ trunk/hornetq-core/src/main/resources/schema/hornetq-configuration.xsd 2012-02-17
15:39:03 UTC (rev 12138)
@@ -146,12 +146,10 @@
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="create-bindings-dir" type="xsd:boolean">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0"
name="page-max-concurrent-io" type="xsd:int">
- </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="page-max-concurrent-io" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0"
name="journal-directory" type="xsd:string">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0"
name="create-journal-dir" type="xsd:boolean">
- </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="create-journal-dir" type="xsd:boolean"/>
<xsd:element maxOccurs="1" minOccurs="0"
name="journal-type" type="journalType">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="journal-buffer-timeout" type="xsd:long">
@@ -316,13 +314,19 @@
<xsd:element maxOccurs="1" minOccurs="0"
name="transformer-class-name" type="xsd:string">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="min-large-message-size" type="xsd:int">
- </xsd:element>
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="check-period" type="xsd:long">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="connection-ttl" type="xsd:long">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="retry-interval" type="xsd:long">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="retry-interval-multiplier" type="xsd:double">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0"
name="reconnect-attempts" type="xsd:int">
+ <xsd:element maxOccurs="1" minOccurs="0"
name="max-retry-interval" type="xsd:long">
</xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="reconnect-attempts" type="xsd:long">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="failover-on-server-shutdown" type="xsd:boolean">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="use-duplicate-detection" type="xsd:boolean">
@@ -358,9 +362,22 @@
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1"
name="connector-ref" type="xsd:string">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0"
name="min-large-message-size" type="xsd:int"/>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="check-period" type="xsd:long">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="connection-ttl" type="xsd:long">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="min-large-message-size" type="xsd:int">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="call-timeout" type="xsd:long">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="retry-interval" type="xsd:long">
</xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="retry-interval-multiplier" type="xsd:double">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="max-retry-interval" type="xsd:long">
+ </xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0"
name="reconnect-attempts" type="xsd:long">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="use-duplicate-detection" type="xsd:boolean">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="forward-when-no-consumers" type="xsd:boolean">
@@ -369,7 +386,6 @@
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0"
name="confirmation-window-size" type="xsd:int">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0"
name="call-timeout" type="xsd:long"/>
<xsd:element maxOccurs="1" minOccurs="0"
name="call-failover-timeout" type="xsd:long"/>
<xsd:choice>
<xsd:element maxOccurs="1" minOccurs="0"
name="static-connectors">
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:31:33 UTC (rev 12137)
+++
trunk/hornetq-core/src/test/java/org/hornetq/core/config/impl/FileConfigurationTest.java 2012-02-17
15:39:03 UTC (rev 12138)
@@ -201,11 +201,14 @@
Assert.assertEquals("bridge1", bc.getName());
Assert.assertEquals("queue1", bc.getQueueName());
Assert.assertEquals("minLargeMessageSize", 4,
bc.getMinLargeMessageSize());
+ assertEquals("check-period", 31,
bc.getClientFailureCheckPeriod());
+ assertEquals("connection time-to-live", 370,
bc.getConnectionTTL());
Assert.assertEquals("bridge-forwarding-address1",
bc.getForwardingAddress());
Assert.assertEquals("sku > 1", bc.getFilterString());
Assert.assertEquals("org.foo.BridgeTransformer",
bc.getTransformerClassName());
Assert.assertEquals(3, bc.getRetryInterval());
- Assert.assertEquals(0.2, bc.getRetryIntervalMultiplier());
+ Assert.assertEquals(0.2, bc.getRetryIntervalMultiplier(), 0.0001);
+ assertEquals("max retry interval", 10002,
bc.getMaxRetryInterval());
Assert.assertEquals(2, bc.getReconnectAttempts());
Assert.assertEquals(true, bc.isUseDuplicateDetection());
Assert.assertEquals("connector1",
bc.getStaticConnectors().get(0));
@@ -230,6 +233,8 @@
{
Assert.assertEquals("cluster-connection1", ccc.getName());
Assert.assertEquals("clusterConnectionConf minLargeMessageSize",
321, ccc.getMinLargeMessageSize());
+ assertEquals("check-period", 331,
ccc.getClientFailureCheckPeriod());
+ assertEquals("connection time-to-live", 3370,
ccc.getConnectionTTL());
Assert.assertEquals("queues1", ccc.getAddress());
Assert.assertEquals(3, ccc.getRetryInterval());
Assert.assertEquals(true, ccc.isDuplicateDetection());
@@ -237,6 +242,9 @@
Assert.assertEquals(1, ccc.getMaxHops());
Assert.assertEquals(123, ccc.getCallTimeout());
Assert.assertEquals(123, ccc.getCallFailoverTimeout());
+ assertEquals("multiplier", 0.25, ccc.getRetryIntervalMultiplier(),
0.00001);
+ assertEquals("max retry interval", 10000,
ccc.getMaxRetryInterval());
+ assertEquals(72, ccc.getReconnectAttempts());
Assert.assertEquals("connector1",
ccc.getStaticConnectors().get(0));
Assert.assertEquals("connector2",
ccc.getStaticConnectors().get(1));
Assert.assertEquals(null, ccc.getDiscoveryGroupName());
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:31:33 UTC (rev 12137)
+++ trunk/hornetq-core/src/test/resources/ConfigurationTest-full-config.xml 2012-02-17
15:39:03 UTC (rev 12138)
@@ -35,8 +35,8 @@
<bindings-directory>somedir</bindings-directory>
<create-bindings-dir>false</create-bindings-dir>
<journal-directory>somedir2</journal-directory>
+ <create-journal-dir>false</create-journal-dir>
<page-max-concurrent-io>17</page-max-concurrent-io>
- <create-journal-dir>false</create-journal-dir>
<journal-type>NIO</journal-type>
<journal-compact-min-files>123</journal-compact-min-files>
<journal-compact-percentage>33</journal-compact-percentage>
@@ -149,8 +149,11 @@
<filter string="sku > 1"/>
<transformer-class-name>org.foo.BridgeTransformer</transformer-class-name>
<min-large-message-size>4</min-large-message-size>
+ <check-period>31</check-period>
+ <connection-ttl>370</connection-ttl>
<retry-interval>3</retry-interval>
<retry-interval-multiplier>0.2</retry-interval-multiplier>
+ <max-retry-interval>10002</max-retry-interval>
<reconnect-attempts>2</reconnect-attempts>
<failover-on-server-shutdown>false</failover-on-server-shutdown>
<use-duplicate-detection>true</use-duplicate-detection>
@@ -166,10 +169,16 @@
</bridges>
<cluster-connections>
<cluster-connection name="cluster-connection1">
- <address>queues1</address>
- <connector-ref>connector1</connector-ref>
- <min-large-message-size>321</min-large-message-size>
- <retry-interval>3</retry-interval>
+ <address>queues1</address>
+ <connector-ref>connector1</connector-ref>
+ <check-period>331</check-period>
+ <connection-ttl>3370</connection-ttl>
+ <min-large-message-size>321</min-large-message-size>
+ <call-timeout>123</call-timeout>
+ <retry-interval>3</retry-interval>
+ <retry-interval-multiplier>0.25</retry-interval-multiplier>
+ <max-retry-interval>10000</max-retry-interval>
+ <reconnect-attempts>72</reconnect-attempts>
<use-duplicate-detection>true</use-duplicate-detection>
<forward-when-no-consumers>false</forward-when-no-consumers>
<max-hops>1</max-hops>
@@ -183,6 +192,7 @@
<cluster-connection name="cluster-connection2">
<address>queues2</address>
<connector-ref>connector2</connector-ref>
+ <call-timeout>456</call-timeout>
<retry-interval>4</retry-interval>
<use-duplicate-detection>false</use-duplicate-detection>
<forward-when-no-consumers>true</forward-when-no-consumers>