JBoss hornetq SVN: r8800 - tags.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-01-13 10:54:28 -0500 (Wed, 13 Jan 2010)
New Revision: 8800
Added:
tags/HornetQ_2_0_0_GA/
Log:
tagged HornetQ 2.0.0 GA
Copied: tags/HornetQ_2_0_0_GA (from rev 8799, tags/HornetQ_2_0_0_GA_pending)
14 years, 11 months
JBoss hornetq SVN: r8799 - tags.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-13 04:55:09 -0500 (Wed, 13 Jan 2010)
New Revision: 8799
Added:
tags/HornetQ_2_0_0_GA_pending/
Log:
pending tag for 2.0.GA
Copied: tags/HornetQ_2_0_0_GA_pending (from rev 8798, trunk)
14 years, 11 months
JBoss hornetq SVN: r8798 - in trunk: src/config/common and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-13 04:50:07 -0500 (Wed, 13 Jan 2010)
New Revision: 8798
Modified:
trunk/docs/README.html
trunk/src/config/common/hornetq-version.properties
Log:
update version and readme
Modified: trunk/docs/README.html
===================================================================
--- trunk/docs/README.html 2010-01-12 17:00:44 UTC (rev 8797)
+++ trunk/docs/README.html 2010-01-13 09:50:07 UTC (rev 8798)
@@ -3,22 +3,22 @@
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
- <title>HornetQ 2.0.0 CR3 Release Notes</title>
+ <title>HornetQ 2.0.0 GA Release Notes</title>
</head>
<body>
-<h1>Release Notes - HornetQ - Version 2.0.0 CR3</h1>
+<h1>Release Notes - HornetQ - Version 2.0.0 GA</h1>
<br>
-<h2>6th January 2010</h2>
+<h2>13th January 2010</h2>
-These are the release notes for HornetQ 2.0.0 CR 3<br><br>
+These are the release notes for HornetQ 2.0.0 GA<br><br>
For full description of the contents please see the
-<a href="https://jira.jboss.org/jira/secure/ReleaseNote.jspa?projectId=12310830&st...">HornetQ project JIRA</a>.<br><br>
+<a href="https://jira.jboss.org/jira/secure/ReleaseNote.jspa?projectId=12310830&st...">HornetQ project JIRA</a>.<br><br>
-This release is a candidate release for forthcoming HornetQ 2.0.0.GA<br>
+This is a general availability (GA) release for HornetQ 2.0.0<br>
<br>
Modified: trunk/src/config/common/hornetq-version.properties
===================================================================
--- trunk/src/config/common/hornetq-version.properties 2010-01-12 17:00:44 UTC (rev 8797)
+++ trunk/src/config/common/hornetq-version.properties 2010-01-13 09:50:07 UTC (rev 8798)
@@ -1,8 +1,8 @@
-hornetq.version.versionName=yellowjacket
+hornetq.version.versionName=Hornet Queen
hornetq.version.majorVersion=2
hornetq.version.minorVersion=0
hornetq.version.microVersion=0
-hornetq.version.incrementingVersion=112
-hornetq.version.versionSuffix=CR3
-hornetq.version.versionTag=CR3
+hornetq.version.incrementingVersion=113
+hornetq.version.versionSuffix=GA
+hornetq.version.versionTag=GA
hornetq.netty.version=(a)NETTY.VERSION@
14 years, 11 months
JBoss hornetq SVN: r8797 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-12 12:00:44 -0500 (Tue, 12 Jan 2010)
New Revision: 8797
Modified:
trunk/docs/user-manual/en/appserver-integration.xml
trunk/docs/user-manual/en/clusters.xml
trunk/docs/user-manual/en/connection-ttl.xml
trunk/docs/user-manual/en/core-bridges.xml
trunk/docs/user-manual/en/duplicate-detection.xml
trunk/docs/user-manual/en/ha.xml
trunk/docs/user-manual/en/jms-bridge.xml
trunk/docs/user-manual/en/logging.xml
trunk/docs/user-manual/en/perf-tuning.xml
trunk/docs/user-manual/en/security.xml
trunk/docs/user-manual/en/transaction-config.xml
Log:
last of the docs edits
Modified: trunk/docs/user-manual/en/appserver-integration.xml
===================================================================
--- trunk/docs/user-manual/en/appserver-integration.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/appserver-integration.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -18,11 +18,11 @@
<!-- ============================================================================= -->
<chapter id="appserver-integration">
<title>Application Server Integration and Java EE</title>
- <para>HornetQ can be easily installed in JBoss Application Server 5.1 or later. For details on
+ <para>HornetQ can be easily installed in JBoss Application Server 4 or later. For details on
installing HornetQ in the JBoss Application Server please refer to quick-start guide.</para>
<para>Since HornetQ also provides a JCA adaptor, it should also be possible to integrate HornetQ
as a JMS provider in other JEE compliant app servers. For instructions on how to integrate a
- remote JCA adaptor into another application sever, please consult that application server's
+ remote JCA adaptor into another application sever, please consult the other application server's
instructions.</para>
<para>A JCA Adapter basically controls the inflow of messages to Message Driven Beans and the
outflow of messages sent from other JEE components, e.g. EJBs and Servlets.</para>
@@ -51,7 +51,7 @@
<para>In this example you can see that the MDB will consume messages from a queue that is
mapped into JNDI with the binding <literal>queue/testQueue</literal>. This queue must be
preconfigured in the usual way using the HornetQ configuration files.</para>
- <para>The <literal>ResourceAdapter</literal> annotation is used to specify which ra adapter
+ <para>The <literal>ResourceAdapter</literal> annotation is used to specify which adaptor
should be used. To use this you will need to import <literal
>org.jboss.ejb3.annotation.ResourceAdapter</literal> which can be found in the
<literal>jboss-ejb3-ext-api.jar</literal> which can be found in the jboss
@@ -150,11 +150,11 @@
{
public void onMessage(Message message)
}</programlisting>
- <para>When using Bean Managed Transactions the message delivery to the MBD will occur
+ <para>When using Bean Managed Transactions the message delivery to the MDB will occur
outside the scope of the user transaction and use the acknowledge mode specified by
the user with the <literal>acknowledgeMode</literal> property. There are only 2
acceptable values for this <literal>Auto-acknowledge</literal> and <literal
- >Dups-ok-acknowledge</literal>.Not that because the message delivery is outside
+ >Dups-ok-acknowledge</literal>. Please note that because the message delivery is outside
the scope of the transaction a failure within the MDB will not cause the message to
be redelivered.</para>
<para>A user would control the lifecycle of the transaction something like the
@@ -174,8 +174,9 @@
UserTransaction tx = ctx.getUserTransaction();
tx.begin();
+
//do some stuff within the transaction
- tx.xommit();
+ tx.commit();
}
catch (Exception e)
@@ -225,7 +226,7 @@
@ResourceAdapter("hornetq-ra.rar")
public class MDBMessageSendTxExample implements MessageListener
{
- @Resource(mappedName = "java:JmsXA")
+ @Resource(mappedName = "java:/JmsXA")
ConnectionFactory connectionFactory;
@Resource(mappedName = "queue/replyQueue")
@@ -283,7 +284,7 @@
consume messages from the HornetQ server and also how components such as EJB's or
Servlet's can send messages.</para>
<para>The HornetQ JCA adapter is deployed via the <literal>jms-ra.rar</literal> archive. The
- configuration of the Adapter is found in this archive under <literal
+ configuration of the adapter is found in this archive under <literal
>META-INF/ra.xml</literal>.</para>
<para>The configuration will look something like the following:</para>
<programlisting><resourceadapter>
@@ -358,7 +359,7 @@
<para>There are 3 main parts to this configuration.</para>
<orderedlist>
<listitem>
- <para>A set of global properties for the Adapter</para>
+ <para>A set of global properties for the adapter</para>
</listitem>
<listitem>
<para>The configuration for the outbound part of the adapter. This is used for
Modified: trunk/docs/user-manual/en/clusters.xml
===================================================================
--- trunk/docs/user-manual/en/clusters.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/clusters.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -263,10 +263,16 @@
<para>If you're using the core API to directly instantiate <literal
>ClientSessionFactory</literal> instances, then you can specify the
discovery group parameters directly when creating the session factory. Here's an
- example:final String groupAddress = "231.7.7.7"; final int groupPort = 9876;
+ example:
+ <programlisting>
+ final String groupAddress = "231.7.7.7";
+ final int groupPort = 9876;
SessionFactory factory = HornetQClient.createClientSessionFactory(groupAddress, groupPort);
ClientSession session1 = factory.createClientSession(...); ClientSession
- session2 = factory.createClientSession(...); </para>
+ session2 = factory.createClientSession(...);
+
+ </programlisting>
+ </para>
<para>The <literal>refresh-timeout</literal> can be set directly on the session
factory by using the setter method <literal>setDiscoveryRefreshTimeout() if you
want to change the default value.</literal></para>
@@ -283,7 +289,7 @@
<section>
<title>Server-Side Message Load Balancing</title>
<para>If cluster connections are defined between nodes of a cluster, then HornetQ
- will load balance messages arriving from at a particular node from a client.</para>
+ will load balance messages arriving at a particular node from a client.</para>
<para>Let's take a simple example of a cluster of four nodes A, B, C, and D arranged in a
<emphasis>symmetric cluster</emphasis> (described in <xref linkend="symmetric-cluster" />).
We have a queue called
@@ -423,13 +429,13 @@
<para>When creating connections between nodes of a cluster to form a cluster connection,
HornetQ uses a cluster user and cluster password which is defined in <literal>hornetq-configuration.xml</literal>:</para>
<programlisting>
- <management-cluster-user>HORNETQ.CLUSTER.ADMIN.USER</management-cluster-user>
- <management-cluster-password>CHANGE ME!!</management-cluster-password>
+ <cluster-user>HORNETQ.CLUSTER.ADMIN.USER</cluster-user>
+ <cluster-password>CHANGE ME!!</cluster-password>
</programlisting>
- <para>It is imperative that these values are changed from their default, or remote clients will be able to make connections
+ <warning><para>It is imperative that these values are changed from their default, or remote clients will be able to make connections
to the server using the default values. If they are not
changed from the default, HornetQ will detect this and pester you with a warning on every
- start-up.</para>
+ start-up.</para></warning>
</section>
</section>
<section id="clusters.client.loadbalancing">
Modified: trunk/docs/user-manual/en/connection-ttl.xml
===================================================================
--- trunk/docs/user-manual/en/connection-ttl.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/connection-ttl.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -168,6 +168,6 @@
To enable asynchronous connection execution, set the parameter <literal
>async-connection-execution-enabled</literal> in <literal
>hornetq-configuration.xml</literal> to <literal>true</literal> (default value is
- <literal>false</literal>).</para>
+ <literal>true</literal>).</para>
</section>
</chapter>
Modified: trunk/docs/user-manual/en/core-bridges.xml
===================================================================
--- trunk/docs/user-manual/en/core-bridges.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/core-bridges.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -216,6 +216,8 @@
use when creating the bridge connection to the remote server. If it is not
specified the default cluster user specified by <literal>cluster-user</literal>
in <literal>hornetq-configuration.xml</literal> will be used. </para>
+ </listitem>
+ <listitem>
<para><literal>password</literal>. This optional parameter determines the password
to use when creating the bridge connection to the remote server. If it is not
specified the default cluster password specified by <literal
Modified: trunk/docs/user-manual/en/duplicate-detection.xml
===================================================================
--- trunk/docs/user-manual/en/duplicate-detection.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/duplicate-detection.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -119,7 +119,7 @@
</section>
<section>
<title>Duplicate Detection and Bridges</title>
- <para>Core bridges can configured to automatically add a unique duplicate id value (if there
+ <para>Core bridges can be configured to automatically add a unique duplicate id value (if there
isn't already one in the message) before forwarding the message to it's target. This
ensures that if the target server crashes or the connection is interrupted and the
bridge resends the message, then if it has already been received by the target server,
Modified: trunk/docs/user-manual/en/ha.xml
===================================================================
--- trunk/docs/user-manual/en/ha.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/ha.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -268,7 +268,7 @@
global order to ensure a consistent replica state. This is extremely hard to do
in a performant and scalable way, especially when one considers that multiple
threads are changing the live server state concurrently.</para>
- <para>Some messaging systems which provide full state machine replication use
+ <para>It is possible to provide full state machine replication using
techniques such as <emphasis role="italic">virtual synchrony</emphasis>, but
this does not scale well and effectively serializes all operations to a single
thread, dramatically reducing concurrency.</para>
Modified: trunk/docs/user-manual/en/jms-bridge.xml
===================================================================
--- trunk/docs/user-manual/en/jms-bridge.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/jms-bridge.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -246,10 +246,6 @@
<para>This represents a JMS selector expression used for consuming messages from
the source destination. Only messages that match the selector expression
will be bridged from the source to the target destination</para>
- <para>
- <note>Ut is always more efficient to apply selectors on source topic
- subscriptions to source queue consumers</note>
- </para>
<para>The selector expression must follow the <ulink
url="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html">JMS
selector syntax</ulink></para>
Modified: trunk/docs/user-manual/en/logging.xml
===================================================================
--- trunk/docs/user-manual/en/logging.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/logging.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -18,8 +18,8 @@
<!-- ============================================================================= -->
<chapter id="logging">
<title>Logging</title>
- <para>HornetQ has its own Logging Delegate that has no dependencies on any particular logging
- framework. The default Delegate delegates all its logs to the standard <ulink
+ <para>HornetQ has its own logging delegate that has no dependencies on any particular logging
+ framework. The default delegate delegates all its logs to the standard <ulink
url="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/">JDK logging</ulink>,
(a.k.a Java-Util-Logging: JUL). By default the server picks up its JUL configuration from a
<literal>logging.properties</literal> file found in the config directories. This is
Modified: trunk/docs/user-manual/en/perf-tuning.xml
===================================================================
--- trunk/docs/user-manual/en/perf-tuning.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/perf-tuning.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -74,14 +74,14 @@
<para>Disable message timestamp. Use the <literal
>setDisableMessageTimeStamp()</literal> method on the <literal
>MessageProducer</literal> class to disable message timestamps if you don't
- need them. Again this makes the message smaller.</para>
+ need them.</para>
</listitem>
<listitem>
<para>Avoid <literal>ObjectMessage</literal>. <literal>ObjectMessage</literal> is
convenient but it comes at a cost. The body of a <literal
>ObjectMessage</literal> uses Java serialization to serialize it to bytes.
The Java serialized form of even small objects is very verbose so takes up a lot
- of space on the wire, also Java serialization is slow compared to customer
+ of space on the wire, also Java serialization is slow compared to custom
marshalling techniques. Only use <literal>ObjectMessage</literal> if you really
can't use one of the other message types, i.e. if you really don't know the type
of the payload until run-time.</para>
@@ -274,17 +274,6 @@
can.</para>
</listitem>
<listitem>
- <para>Avoid many selectors on a queue. Another common anti-pattern is a single queue
- which has many consumers, each one with a distinct message selector. As messages
- come into the queue they will typically only match one of the consumers. This
- does not normally give good performance since as new consumers are added the
- entire queue has to be scanned for matching messages.</para>
- <para>This anti-pattern can normally be avoided by instead using a topic with many
- durable subscriptions, each subscription defines a message selector. With topic
- subscriptions the selector expression is evaluated by HornetQ before the message
- goes into the subscription, so no scanning is involved.</para>
- </listitem>
- <listitem>
<para>Don't create temporary queues for each request. This common anti-pattern
involves the temporary queue request-response pattern. With the temporary queue
request-response pattern a message is sent to a target and a reply-to header is
Modified: trunk/docs/user-manual/en/security.xml
===================================================================
--- trunk/docs/user-manual/en/security.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/security.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -172,7 +172,7 @@
</configuration>
</programlisting>
- <para>The first thing to note is the element <literal>default-user</literal>. This defines
+ <para>The first thing to note is the element <literal>defaultuser</literal>. This defines
what user will be assumed when the client does not specify a username/password when
creating a session. In this case they will be the user <literal>guest</literal> and have
the role also called <literal>guest</literal>. Multiple roles can be specified for a
@@ -197,7 +197,7 @@
</bean>
</programlisting>
<para>The class <literal>org.hornetq.spi.core.security.HornetQSecurityManagerImpl</literal>
- is the default security manager that reads used by the standalone server.</para>
+ is the default security manager that is used by the standalone server.</para>
<para>HornetQ ships with two other security manager implementations you can use
off-the-shelf; one a JAAS security manager and another for integrating with JBoss
Application Sever security, alternatively you could write your own implementation by
@@ -263,12 +263,10 @@
is configured.</para>
</section>
<section>
- <title>Changing the Management Password for Clustering</title>
- <para>In order for cluster connections to work correctly, each node in the cluster must
- register for management notifications from other nodes. To do this they must perform
- these actions as a user with a role that has <literal>admin</literal> permissions on the
- management addresses.</para>
- <para>This password should always be changed from its default after installation. Please see
- <xref linkend="management"/> for instructions on how to do this.</para>
+ <title>Changing the username/password for clustering</title>
+ <para>In order for cluster connections to work correctly, each node in the cluster must make
+ connections to the other nodes. The username/password they use for this should always be
+ changed from the installation default to prevent a security risk.</para>
+ <para>Please see <xref linkend="management"/> for instructions on how to do this.</para>
</section>
</chapter>
Modified: trunk/docs/user-manual/en/transaction-config.xml
===================================================================
--- trunk/docs/user-manual/en/transaction-config.xml 2010-01-12 15:58:54 UTC (rev 8796)
+++ trunk/docs/user-manual/en/transaction-config.xml 2010-01-12 17:00:44 UTC (rev 8797)
@@ -21,7 +21,7 @@
<para>HornetQ has its own Resource Manager for handling the lifespan of JTA transactions. When a
transaction is started the resource manager is notified and keeps a record of the
transaction and its current state. It is possible in some cases for a transaction to be
- started but the forgotten about. Maybe the client died and never came back. If this happens
+ started but then forgotten about. Maybe the client died and never came back. If this happens
then the transaction will just sit there indefinitely.</para>
<para>To cope with this HornetQ can, if configured, scan for old transactions and rollback any
it finds. The default for this is 3000000 milliseconds (5 minutes), i.e. any transactions older
14 years, 11 months
JBoss hornetq SVN: r8796 - trunk.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-01-12 10:58:54 -0500 (Tue, 12 Jan 2010)
New Revision: 8796
Modified:
trunk/build-maven.xml
Log:
fixed maven script
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-01-12 14:44:17 UTC (rev 8795)
+++ trunk/build-maven.xml 2010-01-12 15:58:54 UTC (rev 8796)
@@ -159,7 +159,7 @@
message="<?xml version="1.0" encoding="UTF-8"?><project>${line.separator}
<modelVersion>4.0.0</modelVersion>${line.separator}
<groupId>org.hornetq</groupId>${line.separator}
- <artifactId>hornetq-bootstrap</artifactId>${line.separator}
+ <artifactId>${jarName}</artifactId>${line.separator}
<version>${hornetq.version}</version>${line.separator}</project>"/>
<copy file="${libDir}/${jarName}.jar" tofile="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar"/>
<checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar" algorithm="md5"/>
14 years, 11 months
JBoss hornetq SVN: r8795 - trunk/tests/src/org/hornetq/tests/integration/cluster/reattach.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-01-12 09:44:17 -0500 (Tue, 12 Jan 2010)
New Revision: 8795
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
Log:
Adding test to replicate HORNETQ-264
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java 2010-01-12 14:34:03 UTC (rev 8794)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java 2010-01-12 14:44:17 UTC (rev 8795)
@@ -25,7 +25,13 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.MessageHandler;
import org.hornetq.core.client.impl.ClientSessionFactoryInternal;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMRegistry;
@@ -232,6 +238,19 @@
}, NUM_THREADS, false);
}
+ // Added do replicate HORNETQ-264
+ public void testO() throws Exception
+ {
+ runTestMultipleThreads(new RunnableT()
+ {
+ @Override
+ public void run(final ClientSessionFactory sf, final int threadNum) throws Exception
+ {
+ doTestO(sf, threadNum);
+ }
+ }, NUM_THREADS, false);
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -1018,11 +1037,7 @@
ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
+ ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
producer.send(message);
ClientMessage message2 = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
@@ -1055,11 +1070,7 @@
ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
+ ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
producer.send(message);
ClientMessage message2 = consumer.receive(MultiThreadRandomReattachTestBase.RECEIVE_TIMEOUT);
@@ -1134,11 +1145,7 @@
ClientProducer producer = sess.createProducer(MultiThreadRandomReattachTestBase.ADDRESS);
- ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
+ ClientMessage message = sess.createMessage(HornetQTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
producer.send(message);
sess.start();
@@ -1160,6 +1167,33 @@
sessCreate.close();
}
+ protected void doTestO(final ClientSessionFactory sf, final int threadNum) throws Exception
+ {
+ ClientSession sessCreate = sf.createSession(false, true, true);
+
+ sessCreate.createQueue(MultiThreadRandomReattachTestBase.ADDRESS,
+ new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()),
+ null,
+ false);
+
+ ClientSession sess = sf.createSession(false, true, true);
+
+ sess.start();
+
+ ClientConsumer consumer = sess.createConsumer(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
+
+ for (int i = 0; i < 100; i++)
+ {
+ Assert.assertNull(consumer.receiveImmediate());
+ }
+
+ sess.close();
+
+ sessCreate.deleteQueue(new SimpleString(threadNum + MultiThreadRandomReattachTestBase.ADDRESS.toString()));
+
+ sessCreate.close();
+ }
+
protected int getLatchWait()
{
return 60000;
@@ -1215,7 +1249,7 @@
@Override
protected ClientSessionFactoryInternal createSessionFactory()
{
- final ClientSessionFactoryInternal sf = (ClientSessionFactoryInternal) HornetQClient.createClientSessionFactory(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
+ final ClientSessionFactoryInternal sf = (ClientSessionFactoryInternal)HornetQClient.createClientSessionFactory(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));
sf.setReconnectAttempts(-1);
sf.setConfirmationWindowSize(1024 * 1024);
@@ -1240,10 +1274,10 @@
for (int i = 0; i < numMessages; i++)
{
ClientMessage message = sessSend.createMessage(HornetQBytesMessage.TYPE,
- false,
- 0,
- System.currentTimeMillis(),
- (byte)1);
+ false,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
message.putIntProperty(new SimpleString("threadnum"), threadNum);
message.putIntProperty(new SimpleString("count"), i);
setBody(message);
14 years, 11 months
JBoss hornetq SVN: r8794 - trunk/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-12 09:34:03 -0500 (Tue, 12 Jan 2010)
New Revision: 8794
Modified:
trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-264
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-01-12 13:23:13 UTC (rev 8793)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-01-12 14:34:03 UTC (rev 8794)
@@ -337,33 +337,38 @@
* and knows that there are no other messages to be delivered.
*/
public synchronized void forceDelivery(final long sequence)
- {
+ {
promptDelivery();
-
- executor.execute(new Runnable()
+
+ Future future = new Future();
+
+ executor.execute(future);
+
+ boolean ok = future.await(10000);
+
+ if (!ok)
{
- public void run()
- {
- try
- {
- // We execute this on the same executor to make sure the force delivery message is written after
- // any delivery is completed
-
- ServerMessage forcedDeliveryMessage = new ServerMessageImpl(storageManager.generateUniqueID(), 50);
+ log.warn("Timed out waiting for executor");
+ }
- forcedDeliveryMessage.putLongProperty(ClientConsumerImpl.FORCED_DELIVERY_MESSAGE, sequence);
- forcedDeliveryMessage.setAddress(messageQueue.getName());
+ try
+ {
+ // We execute this on the same executor to make sure the force delivery message is written after
+ // any delivery is completed
- final SessionReceiveMessage packet = new SessionReceiveMessage(id, forcedDeliveryMessage, 0);
+ ServerMessage forcedDeliveryMessage = new ServerMessageImpl(storageManager.generateUniqueID(), 50);
- channel.send(packet);
- }
- catch (Exception e)
- {
- ServerConsumerImpl.log.error("Failed to send forced delivery message", e);
- }
- }
- });
+ forcedDeliveryMessage.putLongProperty(ClientConsumerImpl.FORCED_DELIVERY_MESSAGE, sequence);
+ forcedDeliveryMessage.setAddress(messageQueue.getName());
+
+ final SessionReceiveMessage packet = new SessionReceiveMessage(id, forcedDeliveryMessage, 0);
+
+ channel.send(packet);
+ }
+ catch (Exception e)
+ {
+ ServerConsumerImpl.log.error("Failed to send forced delivery message", e);
+ }
}
public LinkedList<MessageReference> cancelRefs(final boolean lastConsumedAsDelivered, final Transaction tx) throws Exception
@@ -442,7 +447,7 @@
lock.unlock();
}
- //Outside the lock
+ // Outside the lock
if (transferring)
{
// And we must wait for any force delivery to be executed - this is executed async so we add a future to the
@@ -659,7 +664,7 @@
else
{
// prompt Delivery only if chunk was finished
-
+
messageQueue.deliverAsync();
}
}
14 years, 11 months
JBoss hornetq SVN: r8793 - in trunk: examples/jms/client-side-load-balancing and 1 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-01-12 08:23:13 -0500 (Tue, 12 Jan 2010)
New Revision: 8793
Modified:
trunk/docs/user-manual/en/examples.xml
trunk/examples/jms/client-side-load-balancing/readme.html
trunk/examples/jms/client-side-load-balancing/src/org/hornetq/jms/example/ClientSideLoadBalancingExample.java
Log:
updated client-side load-balancing example
* rewrite the example to show clearly load-balancing behaviour
(without round-robin the message consumption)
* update example + doc to make it clear load-balancing is
at the session level for a single JMS connection
Modified: trunk/docs/user-manual/en/examples.xml
===================================================================
--- trunk/docs/user-manual/en/examples.xml 2010-01-12 09:38:23 UTC (rev 8792)
+++ trunk/docs/user-manual/en/examples.xml 2010-01-12 13:23:13 UTC (rev 8793)
@@ -74,11 +74,11 @@
connections given an IP address using the JMX management API.</para>
</section>
<section>
- <title>Client Side Load-Balancing</title>
+ <title>Client-Side Load-Balancing</title>
<para>The <literal>client-side-load-balancing</literal> example demonstrates how
- subsequent connections created from a JMS <literal>ConnectionFactory</literal> can
+ sessions created from a single JMS <literal>Connection</literal> can
be created to different nodes of the cluster. In other words it demonstrates how
- HornetQ does client side load balancing of connections across the cluster.</para>
+ HornetQ does client-side load-balancing of sessions across the cluster.</para>
</section>
<section id="examples.clustered.grouping">
<title>Clustered Grouping</title>
Modified: trunk/examples/jms/client-side-load-balancing/readme.html
===================================================================
--- trunk/examples/jms/client-side-load-balancing/readme.html 2010-01-12 09:38:23 UTC (rev 8792)
+++ trunk/examples/jms/client-side-load-balancing/readme.html 2010-01-12 13:23:13 UTC (rev 8793)
@@ -8,7 +8,7 @@
<body onload="prettyPrint()">
<h1>JMS Client-Side Load-Balancing Example</h1>
- <p>This example demonstrates how subsequent connections created from a JMS Connection Factory can be created
+ <p>This example demonstrates how sessions created from a single JMS Connection can be created
to different nodes of the cluster. In other words it demonstrates how HornetQ does <b>client side load balancing</b> of
connections across the cluster.</p>
<p>The particular load-balancing policy can be chosen to be random, round-robin or user-defined. Please see the user
@@ -44,58 +44,28 @@
<code>ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
</pre>
- <li>We create three connections, since we are using round-robin load-balancing this should
- result in each connection being connected to a different node of the cluster</li>
+ <li>We create a single connection</li>
<pre class="prettyprint">
<code>
- connectionA = connectionFactory.createConnection();
-
- connectionB = connectionFactory.createConnection();
-
- connectionC = connectionFactory.createConnection();
+ connection = connectionFactory.createConnection();
</code>
</pre>
- <li>We create a JMS Session on each of those connections</li>
+ <li>We create 3 JMS Sessions from the same connection. Since we are using round-robin
+ load-balancing this should result in each sessions being connected to a different node of the cluster</li>
<pre class="prettyprint">
<code>
- Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session sessionA = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session sessionB = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session sessionC = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
</code>
</pre>
- <li>We start the connections to ensure delivery occurs on them</li>
- <pre class="prettyprint">
- <code>
- connectionA.start();
-
- connectionB.start();
-
- connectionC.start();
- </code>
- </pre>
-
- <li>We create JMS MessageConsumer objects on the sessions</li>
- <pre class="prettyprint">
- <code>
- MessageConsumer consumerA = sessionA.createConsumer(queue);
-
- MessageConsumer consumerB = sessionB.createConsumer(queue);
-
- MessageConsumer consumerC = sessionC.createConsumer(queue);
- </code>
- </pre>
-
<li>We create JMS MessageProducer objects on the sessions</li>
<pre class="prettyprint">
<code>
MessageProducer producerA = sessionA.createProducer(queue);
-
MessageProducer producerB = sessionB.createProducer(queue);
-
MessageProducer producerC = sessionC.createProducer(queue);
</code>
</pre>
@@ -108,47 +78,39 @@
for (int i = 0; i < numMessages; i++)
{
TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-
producerA.send(messageA);
-
System.out.println("Sent message: " + messageA.getText());
TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
-
producerB.send(messageB);
-
System.out.println("Sent message: " + messageB.getText());
TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
-
producerC.send(messageC);
-
System.out.println("Sent message: " + messageC.getText());
}
</code>
</pre>
-
- <li>We now consume the messages from each node. The connections must be on different nodes
- since if they shared nodes then the consumers would receive the messages sent from different connections.</li>
+
+ <li>We start the connection to consume messages</li>
<pre class="prettyprint">
<code>
- for (int i = 0; i < numMessages; i ++)
- {
- TextMessage messageA = (TextMessage)consumerA.receive(5000);
-
- System.out.println("Got message: " + messageA.getText() + " from node A");
-
- TextMessage messageB = (TextMessage)consumerB.receive(5000);
-
- System.out.println("Got message: " + messageB.getText() + " from node B");
-
- TextMessage messageC = (TextMessage)consumerC.receive(5000);
-
- System.out.println("Got message: " + messageC.getText() + " from node C");
- }
+ connection.start();
</code>
</pre>
+ <li>We consume messages from the 3 session, one at a time.<br>
+ We try to consume one more message than expected from each session. If
+ the session were not properly load-balanced, we would be missing a
+ message from one of the sessions at the end.</li>
+ <pre class="prettyprint">
+ <code>
+ consume(sessionA, queue, numMessages, "A");
+ consume(sessionB, queue, numMessages, "B");
+ consume(sessionC, queue, numMessages, "C");
+ </code>
+ </pre>
+
<li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
<pre class="prettyprint">
Modified: trunk/examples/jms/client-side-load-balancing/src/org/hornetq/jms/example/ClientSideLoadBalancingExample.java
===================================================================
--- trunk/examples/jms/client-side-load-balancing/src/org/hornetq/jms/example/ClientSideLoadBalancingExample.java 2010-01-12 09:38:23 UTC (rev 8792)
+++ trunk/examples/jms/client-side-load-balancing/src/org/hornetq/jms/example/ClientSideLoadBalancingExample.java 2010-01-12 13:23:13 UTC (rev 8793)
@@ -14,6 +14,7 @@
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
@@ -24,14 +25,11 @@
import org.hornetq.common.example.HornetQExample;
/**
- * This example demonstrates how subsequent connections created from a single connection factory can be load
+ * This example demonstrates how sessions created from a single connection can be load
* balanced across the different nodes of the cluster.
*
* In this example there are three nodes and we use a round-robin client side load-balancing
* policy.
- *
- * Note that the three nodes are deliberately not connected as a cluster so we don't have any server-side
- * load balancing going on.
*
* @author <a href="tim.fox(a)jboss.com>Tim Fox</a>
*/
@@ -47,12 +45,8 @@
{
InitialContext initialContext = null;
- Connection connectionA = null;
+ Connection connection = null;
- Connection connectionB = null;
-
- Connection connectionC = null;
-
try
{
// Step 1. Get an initial context for looking up JNDI from server 0
@@ -65,114 +59,80 @@
ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
// Wait a little while to make sure broadcasts from all nodes have reached the client
- Thread.sleep(2000);
+ Thread.sleep(5000);
- // Step 4. We create three connections, since we are using round-robin load-balancing this should
- // result in each connection being connected to a different node of the cluster
+ // Step 4. We create a single connection
+ connection = connectionFactory.createConnection();
+
+ // Step 5. We create 3 JMS Sessions from the same connection. Since we are using round-robin
+ // load-balancing this should result in each sessions being connected to a different node of the cluster
+ Session sessionA = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session sessionB = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session sessionC = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- connectionA = connectionFactory.createConnection();
-
- connectionB = connectionFactory.createConnection();
-
- connectionC = connectionFactory.createConnection();
-
- // Step 5. We create a JMS Session on each of those connections
- Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Step 6. We start the connections to ensure delivery occurs on them
- connectionA.start();
-
- connectionB.start();
-
- connectionC.start();
-
- // Step 7. We create JMS MessageConsumer objects on the sessions
- MessageConsumer consumerA = sessionA.createConsumer(queue);
-
- MessageConsumer consumerB = sessionB.createConsumer(queue);
-
- MessageConsumer consumerC = sessionC.createConsumer(queue);
-
- // Step 8. We create JMS MessageProducer objects on the sessions
+ // Step 6. We create JMS MessageProducer objects on the sessions
MessageProducer producerA = sessionA.createProducer(queue);
-
MessageProducer producerB = sessionB.createProducer(queue);
-
MessageProducer producerC = sessionC.createProducer(queue);
- // Step 9. We send some messages on each producer
-
+ // Step 7. We send some messages on each producer
final int numMessages = 10;
for (int i = 0; i < numMessages; i++)
{
TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-
producerA.send(messageA);
-
System.out.println("Sent message: " + messageA.getText());
TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
-
producerB.send(messageB);
-
System.out.println("Sent message: " + messageB.getText());
TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
-
producerC.send(messageC);
-
System.out.println("Sent message: " + messageC.getText());
}
+
+ // Step 8. We start the connection to consume messages
+ connection.start();
+
+ // Step 9. We consume messages from the 3 session, one at a time.
+ // We try to consume one more message than expected from each session. If
+ // the session were not properly load-balanced, we would be missing a
+ // message from one of the sessions at the end.
+ consume(sessionA, queue, numMessages, "A");
+ consume(sessionB, queue, numMessages, "B");
+ consume(sessionC, queue, numMessages, "C");
- // Step 10. We now consume the messages from each node. The connections must be on different nodes
- // since if they shared nodes then the consumers would receive the messages sent from different connections.
-
- for (int i = 0; i < numMessages; i++)
- {
- TextMessage messageA = (TextMessage)consumerA.receive(5000);
-
- System.out.println("Got message: " + messageA.getText() + " from node A");
-
- TextMessage messageB = (TextMessage)consumerB.receive(5000);
-
- System.out.println("Got message: " + messageB.getText() + " from node B");
-
- TextMessage messageC = (TextMessage)consumerC.receive(5000);
-
- System.out.println("Got message: " + messageC.getText() + " from node C");
- }
-
return true;
}
finally
{
- // Step 11. Be sure to close our resources!
+ // Step 10. Be sure to close our resources!
- if (connectionA != null)
+ if (connection != null)
{
- connectionA.close();
+ connection.close();
}
- if (connectionB != null)
- {
- connectionB.close();
- }
-
- if (connectionC != null)
- {
- connectionC.close();
- }
-
if (initialContext != null)
{
initialContext.close();
}
}
}
+
+ private void consume(Session session, Queue queue, int numMessages, String node) throws JMSException
+ {
+ MessageConsumer consumer = session.createConsumer(queue);
+ for (int i = 0; i < numMessages; i++)
+ {
+ TextMessage message = (TextMessage)consumer.receive(2000);
+ System.out.println("Got message: " + message.getText() + " from node " + node);
+ }
+
+ System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
+
+ }
}
14 years, 11 months
JBoss hornetq SVN: r8792 - trunk/src/config/common.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-12 04:38:23 -0500 (Tue, 12 Jan 2010)
New Revision: 8792
Modified:
trunk/src/config/common/hornetq-version.properties
Log:
updated version
Modified: trunk/src/config/common/hornetq-version.properties
===================================================================
--- trunk/src/config/common/hornetq-version.properties 2010-01-11 18:09:25 UTC (rev 8791)
+++ trunk/src/config/common/hornetq-version.properties 2010-01-12 09:38:23 UTC (rev 8792)
@@ -2,7 +2,7 @@
hornetq.version.majorVersion=2
hornetq.version.minorVersion=0
hornetq.version.microVersion=0
-hornetq.version.incrementingVersion=111
+hornetq.version.incrementingVersion=112
hornetq.version.versionSuffix=CR3
hornetq.version.versionTag=CR3
hornetq.netty.version=(a)NETTY.VERSION@
14 years, 11 months
JBoss hornetq SVN: r8791 - trunk/src/main/org/hornetq/core/remoting/impl/wireformat.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-11 13:09:25 -0500 (Mon, 11 Jan 2010)
New Revision: 8791
Added:
trunk/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java
Log:
some packets now processed async + queue has not executor to minimise remoting threads being held for too long, also some other tweaks
Added: trunk/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java (rev 0)
+++ trunk/src/main/org/hornetq/core/remoting/impl/wireformat/SessionCommitMessage.java 2010-01-11 18:09:25 UTC (rev 8791)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.remoting.impl.wireformat;
+
+/**
+ * A SessionCommitMessage
+ *
+ * @author tim
+ *
+ *
+ */
+public class SessionCommitMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ /**
+ * @param type
+ */
+ public SessionCommitMessage()
+ {
+ super(PacketImpl.SESS_COMMIT);
+ }
+
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
14 years, 11 months