For integration testing, I have spun up an ignite client inside a docker test container to which I connect with an ignite thin client. I then create a test cache by calling getOrCreateCache and store the reference to it. However, when I try to call cache.put(key, value), it gives me a ClientConnectionException saying that the ignite cluster is unavailable error.
The ClientConnectionException I get.
Finally, at the very end of my testing, I have an @AfterClass which destroys the test cache. However, that line also gives me an ignite cluster is unavailable error.
I first thought that the issue was that my cluster might not have been activated. I tried to fix that by trying to activating the cluster through both code, and also through a terminal when execution is paused. However, that has not fixed my issue.
Before I try to put the value in the cache, I even print out all the caches and the cache seems to have been created and I seem to have a reference to it when I look through the debugger.
Initial container setup
igniteServerContainer =
new GenericContainer("apacheignite/ignite:2.5.0")
.withNetwork(network)
.withNetworkAliases("ignite")
.withExposedPorts(10800);
igniteServerContainer.start();
igniteServerContainer.execInContainer("apache-ignite-fabric/bin/control.sh", "--activate");
ignite = Ignition.startClient(
new ClientConfiguration().setAddresses(igniteServerContainer.getContainerIpAddress() + ":" + igniteServerContainer.getFirstMappedPort())
);
//Cache population
ClientCache<String, TreeSet<Item>> cache = ignite.getOrCreateCache(CACHE_NAME);
key = generateKey();
value = generateValue();
cache.put(key, value);
I have followed the online examples and it should be populating the cache normally, but I just get ClientConnectionExceptions saying the cluster is unavailable and I am very unsure why it is giving me that after being able to connect to the ignite container and then creating the cache normally.