Author: clebert.suconic(a)jboss.com
Date: 2011-07-20 02:02:09 -0400 (Wed, 20 Jul 2011)
New Revision: 11006
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
Log:
fixing tests
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-19
19:59:01 UTC (rev 11005)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-20
06:02:09 UTC (rev 11006)
@@ -112,8 +112,6 @@
private volatile boolean active;
- private volatile boolean stopping;
-
private final String user;
private final String password;
@@ -286,8 +284,6 @@
{
log.debug("Bridge " + this.name + " being stopped");
}
-
- stopping = true;
if (futureScheduledReconnection != null)
{
@@ -408,6 +404,10 @@
if (ref != null)
{
+ if (isTrace)
+ {
+ log.trace(this + " Acking " + ref + " on queue " +
ref.getQueue());
+ }
ref.getQueue().acknowledge(ref);
}
}
@@ -466,7 +466,10 @@
{
if (!active)
{
- log.debug(name + "::Ignoring reference on bridge as it is set to
iniactive ref=" + ref);
+ if (log.isDebugEnabled())
+ {
+ log.debug(this + "::Ignoring reference on bridge as it is set to
iniactive ref=" + ref);
+ }
return HandleStatus.BUSY;
}
@@ -503,7 +506,7 @@
}
catch (HornetQException e)
{
- log.warn("Unable to send message, will try again once bridge
reconnects", e);
+ log.warn("Unable to send message " + ref + ", will try again
once bridge reconnects", e);
refs.remove(ref);
@@ -539,6 +542,11 @@
fail(me.getCode() == HornetQException.DISCONNECTED);
+ tryScheduleRetryReconnect(me.getCode());
+ }
+
+ protected void tryScheduleRetryReconnect(final int code)
+ {
scheduleRetryConnect();
}
@@ -560,7 +568,7 @@
@Override
public String toString()
{
- return this.getClass().getName() + " [name=" + name + ",
queue=" + queue + " targetConnector=" + this.serverLocator +
"]";
+ return this.getClass().getSimpleName() + "@" +
Integer.toHexString(System.identityHashCode(this)) + " [name=" + name + ",
queue=" + queue + " targetConnector=" + this.serverLocator +
"]";
}
protected void fail(final boolean permanently)
@@ -571,6 +579,10 @@
{
try
{
+ if (isTrace)
+ {
+ log.trace("Removing consumer on fail " + this + " from
queue " + queue);
+ }
queue.removeConsumer(this);
}
catch (Exception dontcare)
@@ -591,6 +603,11 @@
{
retryCount = 0;
reconnectAttemptsInUse = reconnectAttempts;
+ if (futureScheduledReconnection != null)
+ {
+ futureScheduledReconnection.cancel(true);
+ futureScheduledReconnection = null;
+ }
}
/* Hook for creating session factory */
@@ -794,6 +811,10 @@
}
+ if (isTrace)
+ {
+ log.trace("Removing consumer on stopRunnable " + this + "
from queue " + queue);
+ }
queue.removeConsumer(BridgeImpl.this);
internalCancelReferences();
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-19
19:59:01 UTC (rev 11005)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-07-20
06:02:09 UTC (rev 11006)
@@ -279,6 +279,15 @@
super.stop();
}
+ protected void tryScheduleRetryReconnect(final int code)
+ {
+ if (code != HornetQException.DISCONNECTED)
+ {
+ scheduleRetryConnect();
+ }
+ }
+
+
protected void fail(final boolean permanently)
{
log.debug("Cluster Bridge " + this.getName() + " failed,
permanently=" + permanently);
Show replies by date