JBoss hornetq SVN: r8452 - trunk/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2009-11-28 17:04:18 -0500 (Sat, 28 Nov 2009)
New Revision: 8452
Modified:
trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java
Log:
just a tweak
Modified: trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java 2009-11-28 22:03:42 UTC (rev 8451)
+++ trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java 2009-11-28 22:04:18 UTC (rev 8452)
@@ -13,8 +13,6 @@
package org.hornetq.core.server.impl;
-import static org.hornetq.core.message.impl.MessageImpl.HDR_ORIGINAL_DESTINATION;
-
import org.hornetq.core.filter.Filter;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.StorageManager;
14 years, 11 months
JBoss hornetq SVN: r8451 - trunk/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2009-11-28 17:03:42 -0500 (Sat, 28 Nov 2009)
New Revision: 8451
Modified:
trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java
Log:
just a tweak
Modified: trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java 2009-11-28 21:09:46 UTC (rev 8450)
+++ trunk/src/main/org/hornetq/core/server/impl/DivertImpl.java 2009-11-28 22:03:42 UTC (rev 8451)
@@ -82,8 +82,6 @@
public void route(final ServerMessage message, final RoutingContext context) throws Exception
{
- SimpleString originalDestination = message.getDestination();
-
// We must make a copy of the message, otherwise things like returning credits to the page won't work
// properly on ack, since the original destination will be overwritten
14 years, 11 months
JBoss hornetq SVN: r8450 - trunk/src/main/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2009-11-28 16:09:46 -0500 (Sat, 28 Nov 2009)
New Revision: 8450
Modified:
trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java
Log:
tweak
Modified: trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2009-11-28 15:40:28 UTC (rev 8449)
+++ trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFile.java 2009-11-28 21:09:46 UTC (rev 8450)
@@ -314,10 +314,6 @@
}
}
}
-
- public void waitCompletion() throws Exception
- {
- }
}
protected class LocalBufferObserver implements TimedBufferObserver
14 years, 11 months
JBoss hornetq SVN: r8449 - trunk/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-28 10:40:28 -0500 (Sat, 28 Nov 2009)
New Revision: 8449
Modified:
trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
add log before connecting the bridge to its destination
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 14:35:39 UTC (rev 8448)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 15:40:28 UTC (rev 8449)
@@ -643,6 +643,8 @@
do
{
+ log.info("Connecting bridge " + name + " to its destination");
+
try
{
if (discoveryAddress != null)
14 years, 11 months
JBoss hornetq SVN: r8448 - trunk/src/main/org/hornetq/core/replication/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-28 09:35:39 -0500 (Sat, 28 Nov 2009)
New Revision: 8448
Modified:
trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
Log:
log exception if the replication manager can not be started
Modified: trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2009-11-28 14:35:00 UTC (rev 8447)
+++ trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2009-11-28 14:35:39 UTC (rev 8448)
@@ -333,7 +333,7 @@
{
public void connectionFailed(HornetQException me)
{
- log.warn("Connection to the backup node failed, removing replication now");
+ log.warn("Connection to the backup node failed, removing replication now", me);
try
{
stop();
14 years, 11 months
JBoss hornetq SVN: r8447 - trunk.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-28 09:35:00 -0500 (Sat, 28 Nov 2009)
New Revision: 8447
Modified:
trunk/.classpath
Log:
removed automatic-failover example from from eclipse's .classpath
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2009-11-28 10:37:27 UTC (rev 8446)
+++ trunk/.classpath 2009-11-28 14:35:00 UTC (rev 8447)
@@ -19,7 +19,6 @@
<classpathentry kind="src" path="examples/core/perf/src"/>
<classpathentry kind="src" path="examples/jms/applet/src"/>
<classpathentry kind="src" path="examples/jms/application-layer-failover/src"/>
- <classpathentry kind="src" path="examples/jms/automatic-failover/src"/>
<classpathentry kind="src" path="examples/jms/bridge/src"/>
<classpathentry kind="src" path="examples/jms/browser/src"/>
<classpathentry kind="src" path="examples/jms/client-kickoff/src"/>
14 years, 11 months
JBoss hornetq SVN: r8446 - trunk/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-28 05:37:27 -0500 (Sat, 28 Nov 2009)
New Revision: 8446
Modified:
trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
bridge reconnection if server is started but not accepting session creation
* if the bridge creates its session while its destination is started but not
accepting session (SESSION_CREATION_REJECTED), retry to create the session
until it succeeds
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 10:15:45 UTC (rev 8445)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 10:37:27 UTC (rev 8446)
@@ -638,59 +638,85 @@
{
return false;
}
+
+ boolean retry = false;
- try
+ do
{
- if (discoveryAddress != null)
+ try
{
- csf = new ClientSessionFactoryImpl(discoveryAddress, discoveryPort);
- }
- else
- {
- csf = new ClientSessionFactoryImpl(connectorPair.a, connectorPair.b);
- }
+ if (discoveryAddress != null)
+ {
+ csf = new ClientSessionFactoryImpl(discoveryAddress, discoveryPort);
+ }
+ else
+ {
+ csf = new ClientSessionFactoryImpl(connectorPair.a, connectorPair.b);
+ }
- csf.setFailoverOnServerShutdown(failoverOnServerShutdown);
- csf.setRetryInterval(retryInterval);
- csf.setRetryIntervalMultiplier(retryIntervalMultiplier);
- csf.setReconnectAttempts(reconnectAttempts);
- csf.setBlockOnPersistentSend(false);
+ csf.setFailoverOnServerShutdown(failoverOnServerShutdown);
+ csf.setRetryInterval(retryInterval);
+ csf.setRetryIntervalMultiplier(retryIntervalMultiplier);
+ csf.setReconnectAttempts(reconnectAttempts);
+ csf.setBlockOnPersistentSend(false);
- // Must have confirmations enabled so we get send acks
+ // Must have confirmations enabled so we get send acks
- csf.setConfirmationWindowSize(confirmationWindowSize);
+ csf.setConfirmationWindowSize(confirmationWindowSize);
- // Session is pre-acknowledge
- session = (ClientSessionInternal)csf.createSession(clusterUser, clusterPassword, false, true, true, true, 1);
+ // Session is pre-acknowledge
+ session = (ClientSessionInternal)csf.createSession(clusterUser, clusterPassword, false, true, true, true, 1);
- if (session == null)
- {
- // This can happen if the bridge is shutdown
- return false;
- }
+ if (session == null)
+ {
+ // This can happen if the bridge is shutdown
+ return false;
+ }
- producer = session.createProducer();
+ producer = session.createProducer();
- session.addFailureListener(BridgeImpl.this);
+ session.addFailureListener(BridgeImpl.this);
- session.setSendAcknowledgementHandler(BridgeImpl.this);
+ session.setSendAcknowledgementHandler(BridgeImpl.this);
- setupNotificationConsumer();
+ setupNotificationConsumer();
- active = true;
+ active = true;
- queue.addConsumer(BridgeImpl.this);
+ queue.addConsumer(BridgeImpl.this);
- queue.deliverAsync(executor);
+ queue.deliverAsync(executor);
- return true;
- }
- catch (Exception e)
- {
- log.warn("Bridge " + name + " is unable to connect to destination. It will be disabled.", e);
+ log.info("Bridge " + name + " is connected to its destination");
- return false;
- }
+ return true;
+ }
+ catch (HornetQException e)
+ {
+ // the session was created while its server was starting, retry it:
+ if (e.getCode() == HornetQException.SESSION_CREATION_REJECTED)
+ {
+ log.warn("Server is starting, retry to create the session for bridge " + name);
+
+ retry = true;
+ continue;
+ }
+ else
+ {
+ log.warn("Bridge " + name + " is unable to connect to destination. It will be disabled.", e);
+
+ return false;
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Bridge " + name + " is unable to connect to destination. It will be disabled.", e);
+
+ return false;
+ }
+ } while(retry);
+
+ return false;
}
// Inner classes -------------------------------------------------
14 years, 11 months
JBoss hornetq SVN: r8445 - trunk/examples/jms/reconnect-same-node.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-11-28 05:15:45 -0500 (Sat, 28 Nov 2009)
New Revision: 8445
Modified:
trunk/examples/jms/reconnect-same-node/readme.html
Log:
updated example read me
Modified: trunk/examples/jms/reconnect-same-node/readme.html
===================================================================
--- trunk/examples/jms/reconnect-same-node/readme.html 2009-11-28 09:56:30 UTC (rev 8444)
+++ trunk/examples/jms/reconnect-same-node/readme.html 2009-11-28 10:15:45 UTC (rev 8445)
@@ -17,8 +17,6 @@
available again across the network.</p>
<p>In the case that the server didn't actually crash, i.e. the network was temporarily unavailable, the client will
be able to resume all its sessions and connections where it left off, 100% transparently.</p>
- <p>This is very similar to automatic failover, the difference being with automatic failover the reconnection
- is to a different server, but in this cases the reconnection is to the <b>same</b> server</p>
<p>In the case that the server <b>did</b> crash and was restarted, on reconnection the server session
clearly won't still exist, so the session will be unable to continue transparently, and any registered
ExceptionListener will be called, to allow any application layer reconnect logic to be called.</p>
14 years, 11 months
JBoss hornetq SVN: r8444 - in trunk/examples/jms: symmetric-cluster and 7 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-11-28 04:56:30 -0500 (Sat, 28 Nov 2009)
New Revision: 8444
Removed:
trunk/examples/jms/automatic-failover/
trunk/examples/jms/symmetric-cluster/server1/KILL_ME
Modified:
trunk/examples/jms/symmetric-cluster/build.xml
trunk/examples/jms/symmetric-cluster/readme.html
trunk/examples/jms/symmetric-cluster/server0/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/server1/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/server2/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/server3/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/server4/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/server5/hornetq-configuration.xml
trunk/examples/jms/symmetric-cluster/src/org/hornetq/jms/example/SymmetricClusterExample.java
Log:
updated examples
Modified: trunk/examples/jms/symmetric-cluster/build.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/build.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/build.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -18,27 +18,22 @@
<import file="../../common/build.xml"/>
<property file="ant.properties"/>
- <target name="run" depends="delete-files">
+ <target name="run">
<antcall target="runExample">
<param name="example.classname" value="org.hornetq.jms.example.SymmetricClusterExample"/>
- <param name="hornetq.example.beans.file" value="server3 server4 server5 server0 server1 server2"/>
+ <param name="hornetq.example.beans.file" value="server0 server1 server2 server3 server4 server5"/>
<param name="java-min-memory" value="50M"/>
<param name="java-max-memory" value="100M"/>
</antcall>
</target>
- <target name="runRemote" depends="delete-files">
+ <target name="runRemote">
<antcall target="runExample">
<param name="example.classname" value="org.hornetq.jms.example.SymmetricClusterExample"/>
<param name="hornetq.example.runServer" value="false"/>
</antcall>
</target>
-
- <target name="delete-files" depends="clean">
- <delete file="./server0/KILL_ME"/>
- <delete file="./server1/KILL_ME"/>
- <delete file="./server2/KILL_ME"/>
- </target>
+
</project>
Modified: trunk/examples/jms/symmetric-cluster/readme.html
===================================================================
--- trunk/examples/jms/symmetric-cluster/readme.html 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/readme.html 2009-11-28 09:56:30 UTC (rev 8444)
@@ -40,16 +40,12 @@
</cluster-connection>
</code>
</pre>
- <p>In this example we create a symmetric cluster of three live nodes, and we also pair each live node
+ <p>In this example we create a symmetric cluster of six live nodes, and we also pair each live node
with it's own backup node. (A backup node is not strictly necessary for a symmetric cluster).</p>
- <p>By providing each node with a backup, we ensure that, in case of failure, the cluster will continue
- without failure, with all connections on live failing over transparently onto the backup.</p>
- <p>In this example will we will demonstrate this by deploying a JMS topic and Queue on all nodes of the cluster
+ <p>In this example will we will demonstrate this by deploying a JMS topic and Queue on all nodes of the cluster
, sending messages to the queue and topic from different nodes, and verifying messages are received correctly
by consumers on different nodes.</p>
- <p>During the example will will also kill each live server in turn, at different times, and verify that the sending
- consuming of messages carries on uninterrupted, as connections transparently fail over from live to backup.</p>
- <p>For more information on configuring HornetQ clustering in general, please see the clustering
+ <p>For more information on configuring HornetQ clustering in general, please see the clustering
section of the user manual.</p>
<h2>Example step-by-step</h2>
<p><i>To run the example, simply type <code>./build.sh</code> (or <code>build.bat</code> on windows) from this directory</i></p>
@@ -79,43 +75,67 @@
</code>
</pre>
- <li>We create three connections, they should be to different nodes of the cluster in a round-robin fashion
+ <li>We create six connections, they should be to different nodes of the cluster in a round-robin fashion
and start them.</li>
<pre class="prettyprint">
<code>
connection0 = cf.createConnection();
-
- connection1 = cf.createConnection();
-
- connection2 = cf.createConnection();
-
- connection0.start();
-
- connection1.start();
-
- connection2.start();
+
+ connection1 = cf.createConnection();
+
+ connection2 = cf.createConnection();
+
+ connection3 = cf.createConnection();
+
+ connection4 = cf.createConnection();
+
+ connection5 = cf.createConnection();
+
+ connection0.start();
+
+ connection1.start();
+
+ connection2.start();
+
+ connection3.start();
+
+ connection4.start();
+
+ connection5.start();
</code>
</pre>
<li>We create a session on each connection.</li>
<pre class="prettyprint">
<code>
- Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session3 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session4 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session5 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
</code>
</pre>
<li>We create a topic subscriber on each server.</li>
<pre class="prettyprint">
<code>
- MessageConsumer subscriber0 = session0.createConsumer(topic);
-
- MessageConsumer subscriber1 = session1.createConsumer(topic);
-
- MessageConsumer subscriber2 = session2.createConsumer(topic);
+ MessageConsumer subscriber0 = session0.createConsumer(topic);
+
+ MessageConsumer subscriber1 = session1.createConsumer(topic);
+
+ MessageConsumer subscriber2 = session2.createConsumer(topic);
+
+ MessageConsumer subscriber3 = session3.createConsumer(topic);
+
+ MessageConsumer subscriber4 = session4.createConsumer(topic);
+
+ MessageConsumer subscriber5 = session5.createConsumer(topic);
</code>
</pre>
@@ -149,123 +169,63 @@
producer2.send(queue, message2);
}
</code>
- </pre>
-
- <li>We kill live server 1, this will cause connection1 to transparently fail over onto server 4.</li>
+ </pre>
+ <li>Verify all subscribers and consumer receive the messages.</li>
<pre class="prettyprint">
<code>
- killServer(1);
- </code>
- </pre>
-
- <li>Verify all subscribers receive the messages.</li>
- <pre class="prettyprint">
- <code>
for (int i = 0; i < numMessages; i++)
- {
- TextMessage received0 = (TextMessage)subscriber0.receive(5000);
-
- if (received0 == null)
- {
- return false;
- }
-
- TextMessage received1 = (TextMessage)subscriber1.receive(5000);
-
- if (received1 == null)
- {
- return false;
- }
-
- TextMessage received2 = (TextMessage)subscriber2.receive(5000);
-
- if (received2 == null)
- {
- return false;
- }
-
- TextMessage received3 = (TextMessage)consumer0.receive(5000);
-
- if (received3 == null)
- {
- return false;
- }
- }
- </code>
- </pre>
+ {
+ TextMessage received0 = (TextMessage)subscriber0.receive(5000);
- <li>Send 500 more messages to the queue and topic.</li>
- <pre class="prettyprint">
- <code>
- for (int i = 0; i < numMessages; i++)
- {
- </code>
- </pre>
+ if (received0 == null)
+ {
+ return false;
+ }
- <li>Half way through sending we kill server 2</li>
- <pre class="prettyprint">
- <code>
- if (i == numMessages / 2)
- {
- killServer(2);
- }
-
- TextMessage message3 = session2.createTextMessage("Topic message 2");
-
- producer2.send(topic, message3);
-
- TextMessage message4 = session2.createTextMessage("Queue message 2");
-
- producer2.send(queue, message4);
- }
- </pre>
+ TextMessage received1 = (TextMessage)subscriber1.receive(5000);
- <li>Verify all the messages are received by the subscribers.</li>
- <pre class="prettyprint">
- <code>
- for (int i = 0; i < numMessages; i++)
- {
+ if (received1 == null)
+ {
+ return false;
+ }
+
+ TextMessage received2 = (TextMessage)subscriber2.receive(5000);
+
+ if (received2 == null)
+ {
+ return false;
+ }
+
+ TextMessage received3 = (TextMessage)subscriber3.receive(5000);
+
+ if (received3 == null)
+ {
+ return false;
+ }
+
+ TextMessage received4 = (TextMessage)subscriber4.receive(5000);
+
+ if (received4 == null)
+ {
+ return false;
+ }
+
+ TextMessage received5 = (TextMessage)subscriber5.receive(5000);
+
+ if (received5 == null)
+ {
+ return false;
+ }
+
+ TextMessage received6 = (TextMessage)consumer0.receive(5000);
+
+ if (received6 == null)
+ {
+ return false;
+ }
+ }
</code>
</pre>
-
- <li>Half way through receiving, we kill server 0.</li>
- <pre class="prettyprint">
- <code>
- if (i == numMessages / 2)
- {
- killServer(0);
- }
-
- TextMessage received0 = (TextMessage)subscriber0.receive(5000);
-
- if (received0 == null)
- {
- return false;
- }
-
- TextMessage received1 = (TextMessage)subscriber1.receive(5000);
-
- if (received1 == null)
- {
- return false;
- }
-
- TextMessage received2 = (TextMessage)subscriber2.receive(5000);
-
- if (received2 == null)
- {
- return false;
- }
-
- TextMessage received3 = (TextMessage)consumer0.receive(5000);
-
- if (received3 == null)
- {
- return false;
- }
- }
- </code>
- </pre>
<li>Be sure to close our resources!</li>
Modified: trunk/examples/jms/symmetric-cluster/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server0/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server0/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,9 +3,8 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup-connector-ref connector-name="backup-connector"/>
+
<!-- Connectors -->
<connectors>
@@ -14,10 +13,6 @@
<param key="port" value="5445"/>
</connector>
- <connector name="backup-connector">
- <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
- <param key="port" value="5448"/>
- </connector>
</connectors>
<!-- Acceptors -->
@@ -34,7 +29,7 @@
<group-address>231.7.7.7</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
- <connector-ref connector-name="netty-connector" backup-connector-name="backup-connector"/>
+ <connector-ref connector-name="netty-connector"/>
</broadcast-group>
</broadcast-groups>
Deleted: trunk/examples/jms/symmetric-cluster/server1/KILL_ME
===================================================================
Modified: trunk/examples/jms/symmetric-cluster/server1/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server1/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server1/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,8 +3,6 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup-connector-ref connector-name="backup-connector"/>
<!-- Connectors -->
@@ -13,11 +11,6 @@
<factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5446"/>
</connector>
-
- <connector name="backup-connector">
- <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
- <param key="port" value="5449"/>
- </connector>
</connectors>
<!-- Acceptors -->
@@ -34,7 +27,7 @@
<group-address>231.7.7.7</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
- <connector-ref connector-name="netty-connector" backup-connector-name="backup-connector"/>
+ <connector-ref connector-name="netty-connector" />
</broadcast-group>
</broadcast-groups>
Modified: trunk/examples/jms/symmetric-cluster/server2/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server2/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server2/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,8 +3,6 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup-connector-ref connector-name="backup-connector"/>
<!-- Connectors -->
@@ -13,11 +11,6 @@
<factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
<param key="port" value="5447"/>
</connector>
-
- <connector name="backup-connector">
- <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
- <param key="port" value="5450"/>
- </connector>
</connectors>
<!-- Acceptors -->
@@ -34,7 +27,7 @@
<group-address>231.7.7.7</group-address>
<group-port>9876</group-port>
<broadcast-period>100</broadcast-period>
- <connector-ref connector-name="netty-connector" backup-connector-name="backup-connector"/>
+ <connector-ref connector-name="netty-connector"/>
</broadcast-group>
</broadcast-groups>
Modified: trunk/examples/jms/symmetric-cluster/server3/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server3/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server3/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,8 +3,6 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup>true</backup>
<!-- Connectors -->
Modified: trunk/examples/jms/symmetric-cluster/server4/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server4/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server4/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,8 +3,6 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup>true</backup>
<!-- Connectors -->
<connectors>
Modified: trunk/examples/jms/symmetric-cluster/server5/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/symmetric-cluster/server5/hornetq-configuration.xml 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/server5/hornetq-configuration.xml 2009-11-28 09:56:30 UTC (rev 8444)
@@ -3,8 +3,6 @@
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<clustered>true</clustered>
-
- <backup>true</backup>
<!-- Connectors -->
<connectors>
Modified: trunk/examples/jms/symmetric-cluster/src/org/hornetq/jms/example/SymmetricClusterExample.java
===================================================================
--- trunk/examples/jms/symmetric-cluster/src/org/hornetq/jms/example/SymmetricClusterExample.java 2009-11-28 09:52:53 UTC (rev 8443)
+++ trunk/examples/jms/symmetric-cluster/src/org/hornetq/jms/example/SymmetricClusterExample.java 2009-11-28 09:56:30 UTC (rev 8444)
@@ -12,14 +12,7 @@
*/
package org.hornetq.jms.example;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
+import javax.jms.*;
import org.hornetq.common.example.HornetQExample;
import org.hornetq.jms.HornetQQueue;
@@ -63,6 +56,12 @@
Connection connection1 = null;
Connection connection2 = null;
+
+ Connection connection3 = null;
+
+ Connection connection4 = null;
+
+ Connection connection5 = null;
try
{
@@ -83,19 +82,31 @@
Topic topic = new HornetQTopic("exampleTopic");
- // Step 3. We create three connections, they should be to different nodes of the cluster in a round-robin fashion
+ // Step 3. We create six connections, they should be to different nodes of the cluster in a round-robin fashion
// and start them
connection0 = cf.createConnection();
-
+
connection1 = cf.createConnection();
connection2 = cf.createConnection();
+
+ connection3 = cf.createConnection();
+
+ connection4 = cf.createConnection();
+
+ connection5 = cf.createConnection();
connection0.start();
connection1.start();
connection2.start();
+
+ connection3.start();
+
+ connection4.start();
+
+ connection5.start();
// Step 4. We create a session on each connection
@@ -104,6 +115,12 @@
Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session3 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session4 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Session session5 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Step 5. We create a topic subscriber on each server
@@ -112,14 +129,17 @@
MessageConsumer subscriber1 = session1.createConsumer(topic);
MessageConsumer subscriber2 = session2.createConsumer(topic);
+
+ MessageConsumer subscriber3 = session3.createConsumer(topic);
+
+ MessageConsumer subscriber4 = session4.createConsumer(topic);
+
+ MessageConsumer subscriber5 = session5.createConsumer(topic);
// Step 6. We create a queue consumer on server 0
MessageConsumer consumer0 = session0.createConsumer(queue);
- // Give a little time for consumers to propagate throughout cluster
- Thread.sleep(2000);
-
// Step 7. We create an anonymous message producer on just one server 2
MessageProducer producer2 = session2.createProducer(null);
@@ -130,23 +150,17 @@
for (int i = 0; i < numMessages; i++)
{
- TextMessage message1 = session2.createTextMessage("Topic message 1");
+ TextMessage message1 = session2.createTextMessage("Topic message " + i);
producer2.send(topic, message1);
- TextMessage message2 = session2.createTextMessage("Queue message 1");
+ TextMessage message2 = session2.createTextMessage("Queue message " + i);
producer2.send(queue, message2);
}
- // Step 9. We kill live server 1, this will cause connection1 to transparently fail over onto server 4
+ // Step 9. Verify all subscribers and the consumer receive the messages
- killServer(1);
-
- Thread.sleep(500);
-
- // Step 9. Verify all subscribers receive the messages
-
for (int i = 0; i < numMessages; i++)
{
TextMessage received0 = (TextMessage)subscriber0.receive(5000);
@@ -169,73 +183,33 @@
{
return false;
}
-
- TextMessage received3 = (TextMessage)consumer0.receive(5000);
-
+
+ TextMessage received3 = (TextMessage)subscriber3.receive(5000);
+
if (received3 == null)
{
return false;
- }
- }
-
- // Step 10. Send 500 more messages to the queue and topic
-
- for (int i = 0; i < numMessages; i++)
- {
- // Step 11. Half way through sending we kill server 2
-
- if (i == numMessages / 2)
- {
- killServer(2);
}
-
- TextMessage message3 = session2.createTextMessage("Topic message 2");
-
- producer2.send(topic, message3);
-
- TextMessage message4 = session2.createTextMessage("Queue message 2");
-
- producer2.send(queue, message4);
- }
-
-
- //Step 11. Verify all the messages are received by the subscribers
-
- for (int i = 0; i < numMessages; i++)
- {
- // Step 12. Half way through receiving, we kill server 0
-
- if (i == numMessages / 2)
+
+ TextMessage received4 = (TextMessage)subscriber4.receive(5000);
+
+ if (received4 == null)
{
- killServer(0);
- }
-
- TextMessage received0 = (TextMessage)subscriber0.receive(5000);
-
- if (received0 == null)
- {
return false;
}
-
- TextMessage received1 = (TextMessage)subscriber1.receive(5000);
-
- if (received1 == null)
+
+ TextMessage received5 = (TextMessage)subscriber5.receive(5000);
+
+ if (received5 == null)
{
return false;
}
+
+ TextMessage received6 = (TextMessage)consumer0.receive(5000);
- TextMessage received2 = (TextMessage)subscriber2.receive(5000);
-
- if (received2 == null)
+ if (received6 == null)
{
return false;
- }
-
- TextMessage received3 = (TextMessage)consumer0.receive(5000);
-
- if (received3 == null)
- {
- return false;
}
}
14 years, 11 months
JBoss hornetq SVN: r8443 - trunk/src/main/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-11-28 04:52:53 -0500 (Sat, 28 Nov 2009)
New Revision: 8443
Modified:
trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
Log:
log exception if the bridge creation fails
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 08:48:09 UTC (rev 8442)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2009-11-28 09:52:53 UTC (rev 8443)
@@ -687,7 +687,7 @@
}
catch (Exception e)
{
- log.warn("Bridge " + name + " is unable to connect to destination. It will be disabled.");
+ log.warn("Bridge " + name + " is unable to connect to destination. It will be disabled.", e);
return false;
}
14 years, 11 months