Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 28676 invoked from network); 7 Apr 2009 22:24:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2009 22:24:43 -0000 Received: (qmail 46783 invoked by uid 500); 7 Apr 2009 22:24:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 46720 invoked by uid 500); 7 Apr 2009 22:24:42 -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 46198 invoked by uid 99); 7 Apr 2009 22:24:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Apr 2009 22:24:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Apr 2009 22:17:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D989523888A3; Tue, 7 Apr 2009 22:16:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r762996 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network: ConduitBridge.java DemandForwardingBridge.java DemandForwardingBridgeSupport.java Date: Tue, 07 Apr 2009 22:16:53 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090407221653.D989523888A3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Tue Apr 7 22:16:53 2009 New Revision: 762996 URL: http://svn.apache.org/viewvc?rev=762996&view=rev Log: tidy up logging for network connectors, make debug level usefull Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java?rev=762996&r1=762995&r2=762996&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/ConduitBridge.java Tue Apr 7 22:16:53 2009 @@ -88,8 +88,8 @@ DemandSubscription ds = i.next(); subscriptionMapByLocalId.remove(ds.getRemoteInfo().getConsumerId()); removeSubscription(ds); - if (LOG.isTraceEnabled()) { - LOG.trace("removing sub on " + localBroker + " from " + remoteBrokerName + " : " + ds.getRemoteInfo()); + if (LOG.isDebugEnabled()) { + LOG.debug(configuration.getBrokerName() + " removing sub on " + localBroker + " from " + remoteBrokerName + " : " + ds.getRemoteInfo()); } } Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java?rev=762996&r1=762995&r2=762996&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java Tue Apr 7 22:16:53 2009 @@ -55,12 +55,15 @@ remoteBrokerName = remoteBrokerInfo.getBrokerName(); if (localBrokerId != null) { if (localBrokerId.equals(remoteBrokerId)) { - LOG.info(configuration.getBrokerName() + " disconnecting remote loop back connection: " + remoteBrokerName); - // waitStarted(); + if (LOG.isTraceEnabled()) { + LOG.trace(configuration.getBrokerName() + " disconnecting remote loop back connection: " + remoteBrokerName); + } ServiceSupport.dispose(this); } } - LOG.debug("counting down remoteBrokerNameKnownLatch with: " + command); + if (LOG.isTraceEnabled()) { + LOG.trace("counting down remoteBrokerNameKnownLatch with: " + command); + } remoteBrokerNameKnownLatch.countDown(); } } @@ -75,7 +78,9 @@ localBrokerPath[0] = localBrokerId; if (remoteBrokerId != null) { if (remoteBrokerId.equals(localBrokerId)) { - LOG.info(configuration.getBrokerName() + " disconnecting local loop back connection."); + if (LOG.isTraceEnabled()) { + LOG.trace(configuration.getBrokerName() + " disconnecting local loop back connection."); + } waitStarted(); ServiceSupport.dispose(this); } Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=762996&r1=762995&r2=762996&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java Tue Apr 7 22:16:53 2009 @@ -273,7 +273,9 @@ protected void startLocalBridge() throws Exception { if (localBridgeStarted.compareAndSet(false, true)) { synchronized (this) { - LOG.debug("starting local Bridge, localBroker=" + localBroker); + if (LOG.isTraceEnabled()) { + LOG.trace(configuration.getBrokerName() + " starting local Bridge, localBroker=" + localBroker); + } remoteBrokerNameKnownLatch.await(); localConnectionInfo = new ConnectionInfo(); @@ -298,7 +300,9 @@ protected void startRemoteBridge() throws Exception { if (remoteBridgeStarted.compareAndSet(false, true)) { - LOG.debug("starting remote Bridge, localBroker=" + localBroker); + if (LOG.isTraceEnabled()) { + LOG.trace(configuration.getBrokerName() + " starting remote Bridge, localBroker=" + localBroker); + } synchronized (this) { if (!isCreatedByDuplex()) { BrokerInfo brokerInfo = new BrokerInfo(); @@ -543,7 +547,7 @@ } if (addConsumerInfo(info)) { if (LOG.isDebugEnabled()) { - LOG.debug(configuration.getBrokerName() + " Forwarding sub on " + localBroker + " from " + remoteBrokerName + " : " + info); + LOG.debug(configuration.getBrokerName() + " bridging sub on " + localBroker + " from " + remoteBrokerName + " : " + info); } } else { if (LOG.isDebugEnabled()) { @@ -558,7 +562,7 @@ BrokerId[] path = destInfo.getBrokerPath(); if (path != null && path.length >= networkTTL) { if (LOG.isDebugEnabled()) { - LOG.debug("Ignoring destination " + destInfo + " restricted to " + networkTTL + " network hops only"); + LOG.debug(configuration.getBrokerName() + " Ignoring destination " + destInfo + " restricted to " + networkTTL + " network hops only"); } return; } @@ -566,7 +570,7 @@ // Ignore this consumer as it's a consumer we locally sent to // the broker. if (LOG.isDebugEnabled()) { - LOG.debug("Ignoring destination " + destInfo + " already routed through this broker once"); + LOG.debug(configuration.getBrokerName() + " Ignoring destination " + destInfo + " already routed through this broker once"); } return; } @@ -577,7 +581,9 @@ tempDest.setConnectionId(localSessionInfo.getSessionId().getConnectionId()); } destInfo.setBrokerPath(appendToBrokerPath(destInfo.getBrokerPath(), getRemoteBrokerPath())); - LOG.debug("Replying destination control command: " + destInfo); + if (LOG.isTraceEnabled()) { + LOG.trace("bridging destination control command: " + destInfo); + } localBroker.oneway(destInfo); } else if (data.getClass() == RemoveInfo.class) { ConsumerId id = (ConsumerId)((RemoveInfo)data).getObjectId(); @@ -634,7 +640,6 @@ protected void serviceLocalCommand(Command command) { if (!disposed) { - final boolean trace = LOG.isTraceEnabled(); try { if (command.isMessageDispatch()) { enqueueCounter.incrementAndGet(); @@ -653,9 +658,8 @@ cameFromRemote = contains( ((ConsumerInfo)consumerInfo).getBrokerPath(),remoteBrokerInfo.getBrokerId()); Message message = configureMessage(md); - if (trace) { - LOG.trace("bridging " + configuration.getBrokerName() + " -> " + remoteBrokerName + ": " + message); - LOG.trace("cameFromRemote = "+cameFromRemote + ", repsonseRequired = " + message.isResponseRequired()); + if (LOG.isDebugEnabled()) { + LOG.debug("bridging " + configuration.getBrokerName() + " -> " + remoteBrokerName + ": " + message); } if (!message.isResponseRequired()) { @@ -702,8 +706,8 @@ } } else { - if (trace) { - LOG.trace("No subscription registered with this network bridge for consumerId " + md.getConsumerId() + " for message: " + md.getMessage()); + if (LOG.isDebugEnabled()) { + LOG.debug("No subscription registered with this network bridge for consumerId " + md.getConsumerId() + " for message: " + md.getMessage()); } } } else if (command.isBrokerInfo()) { @@ -920,7 +924,7 @@ LOG.error("Failed to add static destination " + dest, e); } if (LOG.isTraceEnabled()) { - LOG.trace("Forwarding messages for static destination: " + dest); + LOG.trace("bridging messages for static destination: " + dest); } } } @@ -961,7 +965,7 @@ if (!networkConsumers.isEmpty()) { if (matchFound(candidateConsumers, networkConsumers)) { if (LOG.isDebugEnabled()) { - LOG.debug("subscription: " + consumerInfo + " is duplicated by network subscription: " + LOG.debug(configuration.getBrokerName() + " subscription: " + consumerInfo + " is duplicated by network subscription: " + sub.getConsumerInfo() + ", networkComsumerIds: " + networkConsumers); } isDuplicate = true; @@ -1013,6 +1017,9 @@ // The longer the path to the consumer, the less it's consumer // priority. priority -= info.getBrokerPath().length + 1; + if (LOG.isDebugEnabled()) { + LOG.debug(configuration.getBrokerName() + " using priority :" + priority + " for subscription: " + info); + } } result.getLocalInfo().setPriority(priority); } @@ -1055,8 +1062,8 @@ DemandSubscription sub = subscriptionMapByRemoteId.remove(id); if (sub != null) { removeSubscription(sub); - if (LOG.isTraceEnabled()) { - LOG.trace("removing sub on " + localBroker + " from " + remoteBrokerName + " : " + sub.getRemoteInfo()); + if (LOG.isDebugEnabled()) { + LOG.debug(configuration.getBrokerName() + " removing sub on " + localBroker + " from " + remoteBrokerName + " : " + sub.getRemoteInfo()); } } }