Using Wildcards
Hazelcast supports wildcard configuration for all distributed data structures that
can be configured using Config
, that is, for all except IAtomicLong
,
IAtomicReference
. Using an asterisk (*) character in the name, different
instances of maps, queues, topics, semaphores, etc. can be configured by a
single configuration.
A single asterisk (*) can be placed anywhere inside the configuration name.
For instance, a map named com.hazelcast.test.mymap
can be configured using
one of the following configurations:
<hazelcast>
...
<map name="com.hazelcast.test.*">
...
</map>
<!-- OR -->
<map name="com.hazel*">
...
</map>
<!-- OR -->
<map name="*.test.mymap">
...
</map>
<!-- OR -->
<map name="com.*test.mymap">
...
</map>
...
</hazelcast>
hazelcast:
map:
com.hazelcast.test.*:
...
com.hazel*:
...
"*.test.mymap":
...
com.*test.mymap:
...
Notice that when the "*" character prefixes a value, the whole value should be in quotes when you use the YAML configuration.
A queue named com.hazelcast.test.myqueue
can be configured using one
of the following configurations:
<hazelcast>
...
<queue name="*hazelcast.test.myqueue">
...
</queue>
<!-- OR -->
<queue name="com.hazelcast.*.myqueue">
...
</queue>
...
</hazelcast>
hazelcast:
queue:
"*hazelcast.test.myqueue":
...
com.hazelcast.*.myqueue:
...
|