Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 20746 invoked from network); 23 Feb 2007 20:23:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2007 20:23:17 -0000 Received: (qmail 7310 invoked by uid 500); 23 Feb 2007 20:23:25 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 7262 invoked by uid 500); 23 Feb 2007 20:23:25 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 7247 invoked by uid 99); 23 Feb 2007 20:23:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 12:23:25 -0800 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 12:23:16 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 3FC061A981F; Fri, 23 Feb 2007 12:22:56 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r511080 - in /activemq/branches/activemq-4.1: ./ activemq-core/src/main/java/org/apache/activemq/broker/ activemq-core/src/main/java/org/apache/activemq/broker/region/ activemq-core/src/main/java/org/apache/activemq/command/ Date: Fri, 23 Feb 2007 20:22:55 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070223202256.3FC061A981F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Fri Feb 23 12:22:54 2007 New Revision: 511080 URL: http://svn.apache.org/viewvc?view=rev&rev=511080 Log: r236@34: chirino | 2007-02-23 14:48:10 -0500 Flag a ConnectionContext as being a network connection if it sends us a BrokerInfo. Disable flow control if the producer is on a network connection.. trying to get around a network deadlock. Modified: activemq/branches/activemq-4.1/ (props changed) activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/command/NetworkBridgeFilter.java Propchange: activemq/branches/activemq-4.1/ ------------------------------------------------------------------------------ --- svk:merge (original) +++ svk:merge Fri Feb 23 12:22:54 2007 @@ -1 +1 @@ -635f1f41-eb29-0410-ac9d-be9e2c357fdd:/local/amq-4.1-port:235 +635f1f41-eb29-0410-ac9d-be9e2c357fdd:/local/amq-4.1-port:236 Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java?view=diff&rev=511080&r1=511079&r2=511080 ============================================================================== --- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java (original) +++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java Fri Feb 23 12:22:54 2007 @@ -55,6 +55,7 @@ private MessageAuthorizationPolicy messageAuthorizationPolicy; private AtomicInteger referenceCounter = new AtomicInteger(); private boolean dontSendReponse; + private boolean networkConnection; private final MessageEvaluationContext messageEvaluationContext = new MessageEvaluationContext(); @@ -253,6 +254,14 @@ public void setDontSendReponse(boolean dontSendReponse) { this.dontSendReponse = dontSendReponse; + } + + public synchronized boolean isNetworkConnection() { + return networkConnection; + } + + public synchronized void setNetworkConnection(boolean networkConnection) { + this.networkConnection = networkConnection; } } Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=511080&r1=511079&r2=511080 ============================================================================== --- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java (original) +++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java Fri Feb 23 12:22:54 2007 @@ -125,6 +125,7 @@ private CountDownLatch stopLatch = new CountDownLatch(1); protected final AtomicBoolean asyncException = new AtomicBoolean(false); private ConnectionContext context; + private boolean networkConnection; static class ConnectionState extends org.apache.activemq.state.ConnectionState { private final ConnectionContext context; @@ -693,6 +694,7 @@ context.setUserName(info.getUserName()); context.setConnectionId(info.getConnectionId()); context.setWireFormatInfo(wireFormatInfo); + context.setNetworkConnection(networkConnection); context.incrementReference(); this.manageable = info.isManageable(); @@ -1058,6 +1060,12 @@ this.brokerInfo = info; broker.addBroker(this, info); + networkConnection = true; + for (Iterator iter = localConnectionStates.values().iterator(); iter.hasNext();) { + ConnectionState cs = (ConnectionState) iter.next(); + cs.getContext().setNetworkConnection(true); + } + return null; } Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?view=diff&rev=511080&r1=511079&r2=511080 ============================================================================== --- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java (original) +++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java Fri Feb 23 12:22:54 2007 @@ -280,7 +280,7 @@ public void send(final ConnectionContext context, final Message message) throws Exception { - if (context.isProducerFlowControl()) { + if (context.isProducerFlowControl() && !context.isNetworkConnection()) { if( message.isResponseRequired() ) { if( usageManager.isFull() ) { // System.out.println("Registering callback..."); Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?view=diff&rev=511080&r1=511079&r2=511080 ============================================================================== --- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java (original) +++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java Fri Feb 23 12:22:54 2007 @@ -232,7 +232,7 @@ public void send(final ConnectionContext context, final Message message) throws Exception { - if (context.isProducerFlowControl()) { + if (context.isProducerFlowControl() && !context.isNetworkConnection() ) { if (usageManager.isSendFailIfNoSpace() && usageManager.isFull()) { throw new javax.jms.ResourceAllocationException("Usage Manager memory limit reached"); } else { Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/command/NetworkBridgeFilter.java URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/command/NetworkBridgeFilter.java?view=diff&rev=511080&r1=511079&r2=511080 ============================================================================== --- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/command/NetworkBridgeFilter.java (original) +++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/command/NetworkBridgeFilter.java Fri Feb 23 12:22:54 2007 @@ -56,9 +56,13 @@ } - public boolean matches(MessageEvaluationContext message) throws JMSException{ + public boolean matches(MessageEvaluationContext mec) throws JMSException{ try{ - return matchesForwardingFilter(message.getMessage()); + //for Queues - the message can be acknowledged and dropped whilst still + //in the dispatch loop + //so need to get the reference to it + Message message = mec.getMessage(); + return message != null && matchesForwardingFilter(message); }catch(IOException e){ throw JMSExceptionSupport.create(e); } @@ -132,4 +136,4 @@ this.networkBrokerId = remoteBrokerPath; } -} \ No newline at end of file +}