[jbosscache-commits] JBoss Cache SVN: r6567 - core/trunk/src/main/java/org/jboss/cache.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Sat Aug 16 14:45:25 EDT 2008


Author: mircea.markus
Date: 2008-08-16 14:45:24 -0400 (Sat, 16 Aug 2008)
New Revision: 6567

Modified:
   core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
Log:
added warn re:message_bundling if not using a shared transport

Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-08-16 18:22:44 UTC (rev 6566)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-08-16 18:45:24 UTC (rev 6567)
@@ -42,6 +42,8 @@
 import org.jgroups.JChannel;
 import org.jgroups.StateTransferException;
 import org.jgroups.View;
+import org.jgroups.protocols.TP;
+import org.jgroups.stack.ProtocolStack;
 import org.jgroups.blocks.GroupRequest;
 import org.jgroups.blocks.RspFilter;
 import org.jgroups.util.Rsp;
@@ -297,7 +299,7 @@
          rpcDispatcher = new CommandAwareRpcDispatcher(channel, messageListener, new MembershipListenerAdaptor(),
                invocationContextContainer, invocationContextContainer, interceptorChain, componentRegistry);
       }
-
+      checkAppropriateConfig();
       rpcDispatcher.setRequestMarshaller(marshaller);
       rpcDispatcher.setResponseMarshaller(marshaller);
    }
@@ -756,4 +758,37 @@
       double ration = (double)replicationCount / totalCount * 100d;
       return NumberFormat.getInstance().format(ration) +"%";
    }
+
+   /**
+    * Checks to see whether the cache is using an appropriate JGroups config.
+    */
+   private void checkAppropriateConfig()
+   {
+      //if we use a shared transport do not log any warn message
+      if (configuration.getMultiplexerStack() != null)
+         return;
+      //bundling is not good for sync caches
+      Configuration.CacheMode cacheMode = configuration.getCacheMode();
+      if (!cacheMode.equals(Configuration.CacheMode.LOCAL) && configuration.getCacheMode().isSynchronous())
+      {
+         ProtocolStack stack = ((JChannel)channel).getProtocolStack();
+         TP transport = stack.getTransport();
+         if (transport.isEnableBundling())
+         {
+            log.warn("You have enabled jgroups's message bundling, which is not recommended for sync replication. If there is no particular " +
+                  "reason for this we strongly recommend to disable message bundling in JGroups config (enable_bundling=\"false\").");
+         }
+      }
+      //bundling is good for async caches
+      if (!cacheMode.isSynchronous())
+      {
+         ProtocolStack stack = ((JChannel)channel).getProtocolStack();
+         TP transport = stack.getTransport();
+         if (!transport.isEnableBundling())
+         {
+            log.warn("You have disabled jgroups's message bundling, which is not recommended for async replication. If there is no particular " +
+                  "reason for this we strongly recommend to enable message bundling in JGroups config (enable_bundling=\"true\").");
+         }
+      }
+   }
 }
\ No newline at end of file




More information about the jbosscache-commits mailing list