activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AMQ-5122) Unnecessary log of Stacktrace within DiscoveryNetworkConnector
Date Mon, 31 Mar 2014 22:37:14 GMT

     [ https://issues.apache.org/jira/browse/AMQ-5122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Timothy Bish resolved AMQ-5122.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.10.0

Fixed to only log message at warn level.

> Unnecessary log of Stacktrace within DiscoveryNetworkConnector
> --------------------------------------------------------------
>
>                 Key: AMQ-5122
>                 URL: https://issues.apache.org/jira/browse/AMQ-5122
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Connector
>    Affects Versions: 5.9.0
>            Reporter: Andreas Aumayr
>            Priority: Minor
>             Fix For: 5.10.0
>
>
> Setup:
>  - one embedded broker with a configured networkConnector:
> 	<networkConnectors>
> 		<networkConnector name="linkToParentBroker"
> 			uri="static:(tcp://127.0.0.1:61617)" />
> 	</networkConnectors>
> - a logLevel that shows at leat WARN messages
> - no other broker available (i.e. nobody is listening on tcp://127.0.0.1:61617)
> I would expect to see a warning in the logfiles that indicates: "Hey, I'm not able to
start the network bridge you configured". But instead it prints out the warning and a full
stacktrace.
> {quote}
> 2014-03-27_13:01:21.777 [ActiveMQ Task-1] WARN  o.a.a.network.DiscoveryNetworkConnector
- Could not start network bridge between: vm://localhost?async=false&network=true and:
tcp://127.0.0.1:61617 due to: {}
> java.net.ConnectException: Connection refused: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.6.0_25]
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source) ~[na:1.6.0_25]
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source) ~[na:1.6.0_25]
> 	at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.6.0_25]
> 	at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.6.0_25]
> 	at java.net.Socket.connect(Unknown Source) ~[na:1.6.0_25]
> 	at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:496) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:459) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:138)
~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) ~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:204)
~[activemq-all-5.9.0.jar:5.9.0]
> 	at org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:152)
~[bin/:5.9.0]
> 	at org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent$1.run(SimpleDiscoveryAgent.java:184)
[activemq-all-5.9.0.jar:5.9.0]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_25]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_25]
> 	at java.lang.Thread.run(Unknown Source) [na:1.6.0_25]
> {quote}
> Looking at the code (DiscoveryNetworkConnector.java) we can see that there are two logging
statements. One Warning and one Debug:
> {code:title=DiscoveryNetworkConnector.java|borderStyle=solid}
>                 LOG.warn("Could not start network bridge between: {} and: {} due to:
{}", new Object[]{ localURI, uri, e });
>                 LOG.debug("Start failure exception: ", e);
> {code}
> I think it would be sufficient if the warning logged only the message from the exception,
but not the whole stacktrace.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message