Background:
- I have a web app, spring-based.
- locally on a dev machine I have 2 tomcat instances that runs same app - that way I test how web farm nodes communicates to each other
- I use Jelastic cloud for app deployment
- On Jelastic It's not running as a web-farm, but rolling update mechanism is used (while
AppV1is running atNodeAand handling user requsts I startAppV2@NodeB, warm it up and redirect user requests to it. Goal is to letNodeBcopy all sessions fromNodeA)
Intention
- Current release version is using 3rd server based on NodeJS as a shortcut to MessageBus between nodes. But recently I spotted Ignite and thought it would be great to decrease number of platforms (nodejs) and get just everything in Java.
- So I replaced NodeJS-based messaging with Ignite messaging. Ignite is initialized using Spring XML config and
org.apache.ignite.IgniteSpringBean - When running my app locally with
TcpDiscoveryMulticastIpFinderit works perfectly.NodeAstarts even if there is noNodeBstarted. When I startNodeBit smoothly joins cluster and nodes are connected to each other and communicating perfectly. Most important thing here is that I can start and stop nodes any time and I have non-blocking error-free operation using Ignite messaging.
Issue
- But on Jelastic I don't have multicast, so I have to explicitly define list of IP addresses (use
TcpDiscoveryVmIpFinder), which is ok - I have kind of static host names for each node. BUT now whenNodeAstarts it blocks until it connects toNodeB. And ifNodeBis not there whole app crash (failes to deploy).
Question is How to make it work in scenario
TcpDiscoveryVmIpFinderis usedNodeAstarts (whileNodeBis not started)- Expectation:
NodeAoperates any amount of time correctly (of course I can't send messages to remotes, because there are no remotes connected - that is ok) - At any time
NodeBstarts - Expectation:
NodeAandNodeBfind each other and communicate to each other (basically for sessions replication and other messages) NodeAstopped- Expectation:
NodeBcontinues to operate normally serving user requests - Now switch:
NodeAbecomesNodeBand vice versa; repeat from step 3