-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Juliusz Piwoński opened SPR-13702 and commented
Scenario 1: StompBrokerRelay is initiated correctly and connected to host e.g. foobar.com which was resolved to lets say 192.168.1.100.
Then we start a new server (Rabbit) on another IP address and re-point the DNS name foobar.com to the new address.
Unfortunatelly NettyTcpClient still tries to connect to the old address which is accompanied by the following log entry
2015-11-18 23:52:16.809 INFO 28858 --- [eactor-tcp-io-7] r.io.net.impl.netty.tcp.NettyTcpClient : Failed to connect to foobar.com/192.168.1.100:61613. Attempting reconnect in 5000ms.
||
Scenario 2: similar scenario when resolving host name fails (DNS broken) during StompBrokerRelayMessageHandler initialization.
In consequence handler will never connect to host, even after DNS server is fixed and running.
I'm not sure whose responsibility is to resolve host name again (StompBrokerRelayMessageHandler, Reactor2TcpClient or Netty) but I would point to Reactor2TcpClient client as currently resolving dns names is done only once in:
reactor.io.net.Spec.TcpClientSpec called by Reactor2TcpClient constructor.
I think similar issue was mentioned in reactor/reactor#379
and one of the possible solution could be exposing ReconnectStrategy to configuration (as mentioned a the end of conversation: rstoyanchev/spring-websocket-portfolio#47).
Or simply make resolving host name always with each reconnect attempt (currently fixed 5s).
Is that correct or am I missing something?
environment:
org.springframework:spring-messaging:4.2.1.RELEASE
io.projectreactor:reactor-net:2.0.5.RELEASE
io.netty:netty-all:4.0.32.Final
Affects: 4.2.1
1 votes, 5 watchers