Understanding the "connect retries per host" and ""connect retries" properties.
Let's imagine the situation that I have:
number of solace hosts: 3
connect retries: 2
connect retries per host: 4
What would be the final number of retries, if it would be 24, like 2 x 4 per host? Or how it would work?
Comments
-
There is a very good example of this topic in the docs here: https://docs.solace.com/API/API-Developer-Guide/Configuring-Connection-T.htm#:~:text=Connect%20Retries%20Per%20Host,-When%20using%20a&text=A%20value%20of%200%20means%20make%20a%20single%20connection%20or,reconnect%20to%20first%20host%20listed).
Check out the diagram and example at the bottom of this page.
1 -
-
That's what I get for not testing it myself and going from memory! 😓 Either way, none of us are correct. I just tested with JCSMP 10.19. With the above settings, you get:
AAAAA BBBBB CCCCC AAAAA BBBBB CCCCC
Retries per host = 1 attempt + number of retries. So 4 means 5 attempts in a row.
Then Connect Retries = total number of loops.
So my results don't line up with the docs, @amackenzie..!
JCSMP Channel Properties setting:
channelProps.setConnectRetriesPerHost(4); channelProps.setConnectRetries(2);
Configured 3 hosts, with an invalid VPN name for testing purposes:
11:54:09.170 INFO - DemoPublisher initializing... 11:54:09.586 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 1 of 6, this_host_attempt: 1 of 5) 11:54:12.673 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 1 of 6, this_host_attempt: 2 of 5) 11:54:15.684 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 1 of 6, this_host_attempt: 3 of 5) 11:54:18.708 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 1 of 6, this_host_attempt: 4 of 5) 11:54:21.715 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 1 of 6, this_host_attempt: 5 of 5) 11:54:21.723 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 2 of 6, this_host_attempt: 1 of 5) 11:54:24.751 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 2 of 6, this_host_attempt: 2 of 5) 11:54:27.784 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 2 of 6, this_host_attempt: 3 of 5) 11:54:30.810 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 2 of 6, this_host_attempt: 4 of 5) 11:54:33.846 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 2 of 6, this_host_attempt: 5 of 5) 11:54:33.878 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 3 of 6, this_host_attempt: 1 of 5) 11:54:37.347 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 3 of 6, this_host_attempt: 2 of 5) 11:54:40.796 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 3 of 6, this_host_attempt: 3 of 5) 11:54:44.263 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 3 of 6, this_host_attempt: 4 of 5) 11:54:47.716 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 3 of 6, this_host_attempt: 5 of 5) 11:54:51.169 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 4 of 6, this_host_attempt: 1 of 5) 11:54:54.183 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 4 of 6, this_host_attempt: 2 of 5) 11:54:57.204 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 4 of 6, this_host_attempt: 3 of 5) 11:55:00.227 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 4 of 6, this_host_attempt: 4 of 5) 11:55:03.243 INFO - Client-1: Connecting to host 'orig=localhost, host=localhost' (host 1 of 3, smfclient 1, attempt 4 of 6, this_host_attempt: 5 of 5) 11:55:03.255 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 5 of 6, this_host_attempt: 1 of 5) 11:55:06.329 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 5 of 6, this_host_attempt: 2 of 5) 11:55:09.364 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 5 of 6, this_host_attempt: 3 of 5) 11:55:12.399 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 5 of 6, this_host_attempt: 4 of 5) 11:55:15.423 INFO - Client-1: Connecting to host 'orig=public.messaging.solace.cloud, host=public.messaging.solace.cloud' (host 2 of 3, smfclient 1, attempt 5 of 6, this_host_attempt: 5 of 5) 11:55:15.441 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 6 of 6, this_host_attempt: 1 of 5) 11:55:18.894 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 6 of 6, this_host_attempt: 2 of 5) 11:55:22.354 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 6 of 6, this_host_attempt: 3 of 5) 11:55:25.802 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 6 of 6, this_host_attempt: 4 of 5) 11:55:29.264 INFO - Client-1: Connecting to host 'orig=aaron.messaging.solace.cloud, host=aaron.messaging.solace.cloud' (host 3 of 3, smfclient 1, attempt 6 of 6, this_host_attempt: 5 of 5) 11:55:32.730 INFO - Client-1: Channel Closed (smfclient 1) at com.solacesystems.jcsmp.protocol.impl.TcpChannel.executePostOnce(TcpChannel.java:235) at com.solacesystems.jcsmp.protocol.impl.ChannelOpStrategyClient.performOpen(ChannelOpStrategyClient.java:101) at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.performOpenSingle(TcpClientChannel.java:428) at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.access$800(TcpClientChannel.java:124) at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel$ClientChannelConnect.call(TcpClientChannel.java:2610) at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.open(TcpClientChannel.java:404) at com.solacesystems.jcsmp.impl.JCSMPBasicSession.sniffRouter(JCSMPBasicSession.java:423) at com.solacesystems.jcsmp.impl.JCSMPBasicSession.connect(JCSMPBasicSession.java:1310) at dev.solace.pqdemo.PQPublisher.main(PQPublisher.java:155)
Note, it appears that
channelProps.setConnectRetries(0);
andchannelProps.setConnectRetries(1);
behave the same way in JCSMP... that is: one time through the host list.0