I have a simple script which uses wget in a loop until it succeeds. It eventually succeeds but it fails many times before it does so since the server it is trying to contact is down for a while. How can I reduce the number of "Connection refused" messages I am seeing in my output? I've tried using the --waitretry and --wait flags in wget to reduce the number of wget attempts but I still see many "Connection refused" attempts.
This is what my wget command looks like:
while :; do wget -T 30 -nc --wait=30 http://193.155.44.23 && break; done
And this is what I am seeing in my output:
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
--2021-07-19 17:52:05-- http://193.155.44.23/
Connecting to 193.155.44.23:80... failed: Connection refused.
(repeated many many times)
Tried almost every attempt found here in the community but didn't figure out how to access web through continers created in my Docker Desktop Environment.
This is my last attempt with Ubuntu (also tried Centos and Debian suites):
docker run -i -t --rm=true ubuntu /bin/bash
root#310f7a660efd:/# apt-get update -y
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Could not connect to archive.ubuntu.com:80 (91.189.88.24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.173). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.174). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.31). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused)
Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Unable to connect to archive.ubuntu.com:http:
Err:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Unable to connect to archive.ubuntu.com:http:
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Could not connect to security.ubuntu.com:80 (91.189.91.14). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.31). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.174). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.173). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not connect to archive.ubuntu.com:80 (91.189.88.24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.173). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.174). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.31). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.91.14). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.162). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.31). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.174). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.26). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.24). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.23). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.173). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.88.149). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.
If i ping google.com from the server no problem but just can't access repos.
Seems a proxy problem but just because I set proxy in the Docker settings it allows me to download images from dockerhub.
Also tried DNS fixed to 8.8.8.8.
My OS is Windows 10 and this is Docker info:
Client:
Debug Mode: false
Server:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 3
Server Version: 19.03.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 894--------------16b8817763c29fb
runc version: 425e105d5a03----------9eeede87f
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.184-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: docker-desktop
ID: UL2M:2GDU:GGIH:IO6C:EJWA:YUXM:5DFL:F6Q4:XTFE:K3MN:7474:TY4J
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 38
Goroutines: 58
System Time: 2019-10-07T13:34:51.1886632Z
EventsListeners: 1
HTTP Proxy: xxxxxxxxxxxxxxxx:3128
HTTPS Proxy: xxxxxxxxxxxxxxxx:3128
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
This is quite sad situation since if a container can't access web it's very limited.
Also if I put unreachable path from those stack in my chrome they are perfectly available.
Hope for some advice to put me in the right direction.
After some JMS connectivity problems I've noticed in logs:
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61141 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61156 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61148 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61161 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61192 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61197 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61226 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61273 failed: java.io.EOFException
o.a.a.b.T.Transport:? - Transport Connection to: tcp://100.100.100.100:61241 failed: java.io.EOFException
Why JMS is retrying in such way? Does ActiveMQ client/broker technology have any port discovery/negotation protocol?
ActiveMQ has discovery using IP Multicast and failover mechanisms. Not clear why it reconnects to the same host, failover config may have the same host. Client configuration would be helpful to understand.
I'm trying to connect to my database from my java application, but it refuses the connection, the error given is this one.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1038)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:339)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2247)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2280)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2079)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at MainTest.main(MainTest.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:214)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:298)
... 20 more
Searching I found that the problem is not the code, but the connection to my localchost, since I can connect to localhost if I go to my web browser and just going to 'localhost', I can't make a telnet to localhost or 127.0.0.1, it refuses the connection.
MacBook-Pro:etc alejandro-trabajo$ telnet localhost
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
telnet: Unable to connect to remote host
I've tried everything I found in the web, make a new 'hosts' file, flushing the dns, restarting the apache server, uncommenting the "ServerName localhost" in the httpd.conf file... I really don't know what to do.
PS: The ping to localhost works perfectly
MacBook-Pro:etc alejandro-trabajo$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.048 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.126 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.121 ms
^C
--- localhost ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.048/0.092/0.126/0.032 ms
Maybe this will help.
~ $ ifconfig
...
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 8c:85:90:94:fb:70
inet6 fe80::14aa:f1f1:ede3:b942%en0 prefixlen 64 secured scopeid 0x8
inet 192.168.1.100
~ $ telnet localhost 1234
Trying ::1...`enter code here`
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
~ $ telnet 127.0.0.1 1234
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
~ $ telnet 192.168.1.100 1234
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.
This is a simple server
We're using Active MQ 5.6.0, and have configured a number of JMS message listeners (17 currently), each using a Spring 3.1.1 DefaultMessageListenerContainer, deploying to a Jetty 7.
First of all, message routing and handling works and performs fine. The problem is the time it takes to deploy the Spring configuration: each deployment takes longer than the one before it, so we're talking something like polynomial rather than linear time. That's going to be crippling if we ever get to 30 or so.
The example (trimmed) log file shows the 17 deployments appearing to fight one another for connection, until - after over 2.5 minutes - all are connected:
22:33:21,147 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:33:22,148 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:33:23,160 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:33:23,166 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerA' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:33:24,160 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:33:24,172 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerB' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:33:25,173 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerC' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:33:26,184 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerD' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:33:27,166 - (Def...r) - JMS message listener invoker needs to establish shared Connection
[*snip*]
22:35:25,135 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:26,146 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:27,167 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerD' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:28,178 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerE' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:29,179 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerF' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:31,191 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerG' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:32,192 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:33,203 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:34,214 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:35,225 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:36,229 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:37,230 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:38,242 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:40,266 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerC' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:41,277 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerB' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:42,280 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerA' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:44,292 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:45,293 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:46,294 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:47,300 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:48,282 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:35:48,311 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:49,322 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:50,322 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:51,323 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerG' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:53,345 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerF' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:54,366 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerE' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:55,367 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerD' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:56,378 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:57,389 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:58,394 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:35:59,400 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:00,396 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:01,409 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:02,412 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:03,421 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerO' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:04,422 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerA' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:05,426 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerB' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:06,437 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerC' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:09,471 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerO' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:10,472 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:11,483 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:12,483 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:13,459 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:36:13,494 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:14,515 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:15,516 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:16,518 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:17,530 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerD' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:18,541 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerE' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:19,542 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerF' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:21,546 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerG' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:22,557 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:23,569 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:24,580 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:25,581 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:26,582 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:27,593 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:28,594 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:29,605 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerO' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:30,616 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerP' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:32,638 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerC' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:33,639 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerB' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:34,650 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerA' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:36,674 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerP' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:37,685 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerO' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:38,805 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:39,806 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:40,653 - (Def...r) - JMS message listener invoker needs to establish shared Connection
22:36:40,807 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:41,824 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:42,825 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:43,837 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:44,838 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:45,851 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerG' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:47,863 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerF' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:48,874 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerE' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:49,875 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerD' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:50,876 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerH' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:51,891 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerI' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:52,902 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerJ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:53,913 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerK' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:54,924 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerL' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:55,925 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerM' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:56,926 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerN' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:57,937 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerO' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:58,935 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerP' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:36:59,936 - (Def...r) - Could not refresh JMS Connection for destination 'queue://HandlerQ' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
22:37:00,520 - (Def...r) - Successfully refreshed JMS Connection
For the sake of brevity, I won't post each Spring bean, but here are the important bits:
<jee:jndi-lookup id="srcConnectionFactory" jndi-name="${jndi.jms.connfactory}">
<jee:environment>
java.naming.factory.initial = ${jndi.jms.naming.factory.initial}
java.naming.provider.url = ${jndi.jms.naming.url}
</jee:environment>
</jee:jndi-lookup>
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="srcConnectionFactory"/>
<property name="cacheConsumers" value="false"/>
<property name="reconnectOnException" value="true"/>
<property name="sessionCacheSize" value="20"></property>
</bean>
<jee:jndi-lookup id="handlerA_Dest" jndi-name="handlerA">
<jee:environment>
java.naming.factory.initial = ${jndi.jms.naming.factory.initial}
java.naming.provider.url = ${jndi.jms.naming.url}
queue.handlerA = handlerA
</jee:environment>
</jee:jndi-lookup>
[x 17]
<bean id="handlerA_Container" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
p:connectionFactory-ref="connectionFactory"
p:messageListener-ref="handlerA"
p:destination-ref="handlerA_Dest">
<property name="concurrentConsumers"><value>10</value></property>
<property name="maxConcurrentConsumers"><value>10</value></property>
<property name="idleConsumerLimit"><value>5</value></property>
</bean>
[x 17]
Any idea why these containers should be contending at all?
Unfortunately, the MessageSelector approach is not (any longer) an option for us. It's one Listener per type-of-Message.
Update It's true that, strictly speaking, the MQ broker is indeed down at the start of this deployment, but it's deployed into the same Jetty (this all happens in the Maven integration test phase), so even if there was a brief period where the broker started up second, I wouldn't expect it to be 2-3 minutes late.
What I'm seeing looks really looks like the broker deployment is being 'blocked' by this Spring deployment...
This is nothing to do with Spring or contention between clients.
The broker wasn't available from 22:33:23,166 until 22:37:00,520.
Cause: Could not connect to broker URL: tcp://0.0.0.0:61616. Reason: java.net.ConnectException: Connection refused: connect
Looks to me like they all connected within 1 millisecond as soon as the broker was available.