[jboss-cvs] JBoss Messaging SVN: r8337 - in branches/JBMESSAGING_1876: src/main/org/jboss/jms/server/connectionfactory and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 14 08:36:14 EDT 2011
Author: gaohoward
Date: 2011-06-14 08:36:13 -0400 (Tue, 14 Jun 2011)
New Revision: 8337
Modified:
branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/ClientConsumer.java
branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/SessionAspect.java
branches/JBMESSAGING_1876/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java
branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
Log:
test and more
Modified: branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/ClientConsumer.java
===================================================================
--- branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/ClientConsumer.java 2011-06-14 08:29:27 UTC (rev 8336)
+++ branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/ClientConsumer.java 2011-06-14 12:36:13 UTC (rev 8337)
@@ -316,7 +316,7 @@
private boolean isClustered = false;
//JBMESSAGING-1876
- private long minTimeoutProcessTime = 50;
+ private long minTimeoutProcessTime;
public int getBufferSize()
{
@@ -658,7 +658,7 @@
}
catch (TimeoutException e)
{
- log.warn("Timed out waiting for post message processing " + m);
+ log.warn("Timed out waiting for post message processing " + m + " within time " + timeLeft);
ignore = false;
sessionDelegate.processMessageTimeout();
}
Modified: branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/SessionAspect.java 2011-06-14 08:29:27 UTC (rev 8336)
+++ branches/JBMESSAGING_1876/src/main/org/jboss/jms/client/container/SessionAspect.java 2011-06-14 12:36:13 UTC (rev 8337)
@@ -421,10 +421,7 @@
{
int ackMode = state.getAcknowledgeMode();
-
- Object[] args = mi.getArguments();
- DeliveryInfo info = (DeliveryInfo)args[0];
-
+
if (ackMode == Session.CLIENT_ACKNOWLEDGE)
{
if (trace)
Modified: branches/JBMESSAGING_1876/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
===================================================================
--- branches/JBMESSAGING_1876/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2011-06-14 08:29:27 UTC (rev 8336)
+++ branches/JBMESSAGING_1876/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2011-06-14 12:36:13 UTC (rev 8337)
@@ -93,7 +93,7 @@
private long retryChangeRateInterval = 5000;
- private long minTimeoutProcessTime = 50;
+ private long minTimeoutProcessTime = 100;
// Constructors ---------------------------------------------------------------------------------
@@ -516,6 +516,16 @@
this.retryChangeRateInterval = retryChangeRateInterval;
}
+ public long getMinTimeoutProcessTime()
+ {
+ return minTimeoutProcessTime;
+ }
+
+ public void setMinTimeoutProcessTime(long minTimeoutProcessTime)
+ {
+ this.minTimeoutProcessTime = minTimeoutProcessTime;
+ }
+
// JMX managed operations -----------------------------------------------------------------------
// Public ---------------------------------------------------------------------------------------
Modified: branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java
===================================================================
--- branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java 2011-06-14 08:29:27 UTC (rev 8336)
+++ branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java 2011-06-14 12:36:13 UTC (rev 8337)
@@ -969,6 +969,109 @@
}
}
+ //https://issues.jboss.org/browse/JBMESSAGING-1876
+ public void testMinTimeoutProcessTimeConfigSettings() throws Exception
+ {
+ Connection c = null;
+
+ try
+ {
+ String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + " name=\"jboss.messaging.connectionfactory:service=TestTimeoutProcessConfigSettingsFactory\"\n"
+ + " xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+ + " <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+ + " <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+ + " <attribute name=\"JNDIBindings\">\n"
+ + " <bindings>\n"
+ + " <binding>/TestTimeoutProcessConfigSettingsFactory</binding>\n"
+ + " </bindings>\n"
+ + " </attribute>\n"
+ + " <attribute name=\"MinTimeoutProcessTime\">2345</attribute>\n"
+ + " </mbean>";
+
+ ObjectName on = ServerManagement.deploy(mbeanConfig);
+ ServerManagement.invoke(on, "create", new Object[0], new String[0]);
+ ServerManagement.invoke(on, "start", new Object[0], new String[0]);
+
+ ConnectionFactory cf = (ConnectionFactory)ic.lookup("/TestTimeoutProcessConfigSettingsFactory");
+ c = cf.createConnection();
+
+ ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
+
+ ConnectionState state1 = (ConnectionState)del1.getState();
+
+ long minTime = state1.getMinTimeoutProcessTime();
+
+ assertEquals(2345, minTime);
+ }
+ finally
+ {
+ try
+ {
+ if (c != null)
+ {
+ log.info("Closing connection");
+ c.close();
+ log.info("Closed connection");
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.toString(), e);
+ }
+ }
+ }
+
+ //https://issues.jboss.org/browse/JBMESSAGING-1876
+ public void testMinTimeoutProcessTimeDefaults() throws Exception
+ {
+ Connection c = null;
+
+ try
+ {
+ String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + " name=\"jboss.messaging.connectionfactory:service=TestTimeoutProcessConfigDefaultSettingsFactory\"\n"
+ + " xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+ + " <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+ + " <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+ + " <attribute name=\"JNDIBindings\">\n"
+ + " <bindings>\n"
+ + " <binding>/TestTimeoutProcessConfigDefaultSettingsFactory</binding>\n"
+ + " </bindings>\n"
+ + " </attribute>\n"
+ + " </mbean>";
+
+ ObjectName on = ServerManagement.deploy(mbeanConfig);
+ ServerManagement.invoke(on, "create", new Object[0], new String[0]);
+ ServerManagement.invoke(on, "start", new Object[0], new String[0]);
+
+ ConnectionFactory cf = (ConnectionFactory)ic.lookup("/TestTimeoutProcessConfigDefaultSettingsFactory");
+ c = cf.createConnection();
+
+ ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
+
+ ConnectionState state1 = (ConnectionState)del1.getState();
+
+ long minTime = state1.getMinTimeoutProcessTime();
+
+ assertEquals(100, minTime);
+ }
+ finally
+ {
+ try
+ {
+ if (c != null)
+ {
+ log.info("Closing connection");
+ c.close();
+ log.info("Closed connection");
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.toString(), e);
+ }
+ }
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
===================================================================
--- branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java 2011-06-14 08:29:27 UTC (rev 8336)
+++ branches/JBMESSAGING_1876/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java 2011-06-14 12:36:13 UTC (rev 8337)
@@ -397,6 +397,169 @@
}
}
+ //JBMESSAGING-1876
+ public void testMinTimeoutProcessTimeSettings() throws Exception
+ {
+ Connection c = null;
+
+ try
+ {
+ String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + " name=\"jboss.messaging.connectionfactory:service=TestChangeRateConfigSettingsFactory\"\n"
+ + " xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+ + " <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+ + " <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+ + " <attribute name=\"JNDIBindings\">\n"
+ + " <bindings>\n"
+ + " <binding>/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory</binding>\n"
+ + " </bindings>\n"
+ + " </attribute>\n"
+ + " <attribute name=\"SupportsFailover\">true</attribute>"
+ + " <attribute name=\"SupportsLoadBalancing\">true</attribute>"
+ + " <attribute name=\"MinTimeoutProcessTime\">100</attribute>\n"
+ + " </mbean>";
+
+ ObjectName on = ServerManagement.deploy(mbeanConfig);
+ ServerManagement.invoke(on, "create", new Object[0], new String[0]);
+ ServerManagement.invoke(on, "start", new Object[0], new String[0]);
+
+ ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory");
+ c = cf.createConnection();
+
+ ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
+
+ ConnectionState state1 = (ConnectionState)del1.getState();
+
+ long minTime = state1.getMinTimeoutProcessTime();
+
+ assertEquals(100, minTime);
+ }
+ finally
+ {
+ try
+ {
+ if (c != null)
+ {
+ log.info("Closing connection");
+ c.close();
+ log.info("Closed connection");
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.toString(), e);
+ }
+ }
+ }
+
+ //https://issues.jboss.org/browse/JBMESSAGING-1876
+ public void testMinTimeoutProcessTimeSettings2() throws Exception
+ {
+ Connection c = null;
+
+ try
+ {
+ String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + " name=\"jboss.messaging.connectionfactory:service=TestChangeRateConfigSettingsFactory\"\n"
+ + " xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+ + " <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+ + " <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+ + " <attribute name=\"JNDIBindings\">\n"
+ + " <bindings>\n"
+ + " <binding>/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory</binding>\n"
+ + " </bindings>\n"
+ + " </attribute>\n"
+ + " <attribute name=\"SupportsFailover\">false</attribute>"
+ + " <attribute name=\"SupportsLoadBalancing\">true</attribute>"
+ + " <attribute name=\"MinTimeoutProcessTime\">100</attribute>\n"
+ + " <attribute name=\"MaxRetryChangeRate\">10</attribute>\n"
+ + " <attribute name=\"RetryChangeRateInterval\">2345</attribute>\n"
+ + " </mbean>";
+
+ ObjectName on = ServerManagement.deploy(mbeanConfig);
+ ServerManagement.invoke(on, "create", new Object[0], new String[0]);
+ ServerManagement.invoke(on, "start", new Object[0], new String[0]);
+
+ ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory");
+ c = cf.createConnection();
+
+ ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
+
+ ConnectionState state1 = (ConnectionState)del1.getState();
+
+ long minTime = state1.getMinTimeoutProcessTime();
+
+ assertEquals(100, minTime);
+ }
+ finally
+ {
+ try
+ {
+ if (c != null)
+ {
+ log.info("Closing connection");
+ c.close();
+ log.info("Closed connection");
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.toString(), e);
+ }
+ }
+ }
+
+ //https://issues.jboss.org/browse/JBMESSAGING-1876
+ public void testMinTimeoutProcessTimeDefaults() throws Exception
+ {
+ Connection c = null;
+
+ try
+ {
+ String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + " name=\"jboss.messaging.connectionfactory:service=TestChangeRateConfigDefaultsFactory\"\n"
+ + " xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+ + " <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+ + " <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+ + " <attribute name=\"JNDIBindings\">\n"
+ + " <bindings>\n"
+ + " <binding>/ClusteredTestChangeRateConfigDefaultsFactory</binding>\n"
+ + " </bindings>\n"
+ + " </attribute>\n"
+ + " <attribute name=\"SupportsFailover\">true</attribute>"
+ + " <attribute name=\"SupportsLoadBalancing\">true</attribute>"
+ + " </mbean>";
+
+ ObjectName on = ServerManagement.deploy(mbeanConfig);
+ ServerManagement.invoke(on, "create", new Object[0], new String[0]);
+ ServerManagement.invoke(on, "start", new Object[0], new String[0]);
+
+ ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestChangeRateConfigDefaultsFactory");
+ c = cf.createConnection();
+
+ ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
+
+ ConnectionState state1 = (ConnectionState)del1.getState();
+
+ long minTime = state1.getMinTimeoutProcessTime();
+
+ assertEquals(100, minTime);
+ }
+ finally
+ {
+ try
+ {
+ if (c != null)
+ {
+ log.info("Closing connection");
+ c.close();
+ log.info("Closed connection");
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.toString(), e);
+ }
+ }
+ }
+
// Package protected ----------------------------------------------------------------------------
// Protected ------------------------------------------------------------------------------------
More information about the jboss-cvs-commits
mailing list