I rate Hazelcast as a distributed data grid solution for the application I'm working on. Hazelcast is configured for a distributed cluster, and my application uses Spring to define the Hazelcast client this way:
<hz:client id="hazelcastClient" group-name="dev" group-password="dev-pass"> <hz:member>localhost:5701</hz:member> </hz:client>
In my Hazelcast node, in the hazelcast.xml
file hazelcast.xml
I configured a map with all the necessary configuration. Let them say that this mapping is called myMap
. I see that this card is configured correctly when using the Hazelcast web application for monitoring (mancenter).
Now I need to configure the card for input to my bean from the application side. If I do something like
<hz:map id="myMap" instance-ref="hazelcastClient" name="myMap" />
And I insert this card into my bean, which contains the sampling logic, I have no problem.
However, I also wrote a class that implements the MapLoader
interface to handle missing cache data. My problem is that I donโt know how to associate this MapLoader
with the cache I specified. If I try something like
<hz:map id="myMap" instance-ref="hazelcastClient" name="myMap"> <hz:map-store enabled="true" implementation="myMapLoader"/> </hz:map>
I get an XML parsing error, because it seems that when hz:map
used as a top-level element (and not inside hz:config
, for example), you cannot specify internal elements. This makes me think that you need to define the hz:config
element. But this is not very clear from the documentation if you can define the hz:config
element for the client. It seems to me that you need to use hz:config
if you want your application to be part of a cluster. I am not sure, however, if he logically fixed that my application should be part of a cluster - it is basically a data mesh client.
Do you have any thoughts on how to configure the application to achieve the desired behavior?
Thanks!
manub source share