How Can we create multiple instances of Ignite when multiple threads are trying to access same Ignite instance.
Ignite ignite = Ignition.start("conf/example-ignite-config.xml");
Here I have started/created one Ignite instance. But using same xml I have to create multiple instances of same without other thread to wait for it to get free.
Ignite instances are thread safe. You should call Ignition.start once and share it between all threads.
Alternatively, once Ignite has been started, you can obtain Ignite instance with Ignition.ignite() methods.
For this, I created a ClientGroup, from one Ignite started in Client mode, i.e.(Cluster group of nodes started in client mode.) and when I need a Ignite node (grid) in client mode I just called a ignite() method of ClientGroup which gets instance of grid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With