2 Replies Latest reply on Jan 2, 2015 12:35 PM by Antairez

    How to get a hazelcast instance in plugin?

    Antairez

      Hello everyone, I am running my server on Openfire 3.10.0 with Hazelcast plugin 1.3.3

       

      I am trying to develop a plugin that supports clustered environment, on the official documentation I see that you can use distributed map to share data between nodes:

      http://docs.hazelcast.org/docs/3.3/manual/html-single/hazelcast-documentation.ht ml#map

       

      I wonder how would I be able to get a hazelcast instance under my openfire plugin? (HazelcastInstance hzInstance = Hazelcast.newHazelcastInstance();)

      Is there any official plugin that supports hazelcast that I can get some hints? Or maybe any experienced dev that can answer my question?

       

       

      Thank you in advance.

        • Re: How to get a hazelcast instance in plugin?
          Tom Evans

          There should be no need to access the Hazelcast instance directly from your plugin. If you would like to use a custom distributed cache within your plugin, you can simply create it via the CacheFactory.createCache(String cacheName) method.

           

          The default HZ cache configuration will work fine for most cases, but if you would like to further customize the cluster configuration for your cache you can update the hazelcast-cache-config.xml file accordingly. Just deploy your custom configuration in the Hazelcast plugin /classes/ directory and restart each cluster member.

           

          If you would like to know more about the many available Hazelcast cache configuration options, I would refer you to the HZ documentation for more information.