[hornetq-commits] JBoss hornetq SVN: r9733 - in trunk/src/main/org/hornetq/core: remoting/server/impl and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Sep 29 04:47:44 EDT 2010


Author: timfox
Date: 2010-09-29 04:47:43 -0400 (Wed, 29 Sep 2010)
New Revision: 9733

Modified:
   trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
   trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
Log:
https://jira.jboss.org/browse/HORNETQ-526

Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java	2010-09-29 07:19:27 UTC (rev 9732)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java	2010-09-29 08:47:43 UTC (rev 9733)
@@ -115,7 +115,19 @@
    {
       StompConnection conn = new StompConnection(connection, this);
 
-      return new ConnectionEntry(conn, 0, 0);
+      //Note that STOMP has no heartbeat, so if connection ttl is non zero, data must continue to be sent or connection will be timed out and closed!
+      
+      long ttl = server.getConfiguration().getConnectionTTLOverride();
+
+      if (ttl != -1)
+      {
+         return new ConnectionEntry(conn, System.currentTimeMillis(), ttl);
+      }
+      else
+      {
+         // Default to 1 minute - which is same as core protocol
+         return new ConnectionEntry(conn, System.currentTimeMillis(), 1 * 60 * 1000);
+      }            
    }
 
    public void removeHandler(String name)

Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2010-09-29 07:19:27 UTC (rev 9732)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2010-09-29 08:47:43 UTC (rev 9733)
@@ -200,7 +200,7 @@
             ProtocolManager manager = protocolMap.get(protocol);
 
             Acceptor acceptor = factory.createAcceptor(info.getParams(),
-                                                       new DelegatingBufferHandler(manager),
+                                                       new DelegatingBufferHandler(),
                                                        manager,
                                                        this,
                                                        threadPool,
@@ -443,13 +443,6 @@
 
    private final class DelegatingBufferHandler implements BufferHandler
    {
-      private ProtocolManager manager;
-
-      DelegatingBufferHandler(final ProtocolManager manager)
-      {
-         this.manager = manager;
-      }
-
       public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
       {
          ConnectionEntry conn = connections.get(connectionID);



More information about the hornetq-commits mailing list