hazelcast xml network tag

78 views
Skip to first unread message

Clément Tamisier

unread,
Oct 3, 2013, 6:18:52 AM10/3/13
to haze...@googlegroups.com
Hi, 

I am using hazelcast for hibernate 2nd cache level.
I use HazelcastCacheRegionFactory in hibernate.cache.region.factory_class property for AnnotationSessionFactoryBean of spring. (Spring 3.1.4, Hibernate 3.6.10.Final and hazelcast 3.0.2).

with my hazelcast.xml file like this:

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-2.5.xsd"
           
xmlns="http://www.hazelcast.com/schema/config"
           
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   
<group>
       
<name>hazelcastNameTestEnvironment</name>
       
<password>dev-pass</password>
   
</group>


   
<network>
       
<join>
           
<multicast enabled="true">
           
</multicast>
       
</join>
   
</network>
</hazelcast>


Everything is fine for me and I can see in the log:

Oct 03, 2013 6:08:33 PM com.hazelcast.cluster.MulticastJoiner
INFO: [172.16.8.115]:5703 [hazelcastNameTestEnvironment] 


Members [1] {
Member [172.16.8.115]:5701 this
}

BUT

 if my hazelcast.xml file is (without the <network> tag):
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-2.5.xsd"
           
xmlns="http://www.hazelcast.com/schema/config"
           
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   
<group>
       
<name>hazelcastNameTestEnvironment</name>
       
<password>dev-pass</password>
   
</group>
</hazelcast>


I have in the log:
Oct 03, 2013 6:05:01 PM com.hazelcast.instance.Node
WARNING: [172.16.8.115]:5701 [hazelcastNameTestEnvironment] No join method is enabled! Starting standalone.


So I think both xml configuration should be similar because in MulticastConfig class, enabled variable is by default at true.

Am I doing something wrong, do you have any ideas ?
Thanks for your help.
Regards

Clément.

Peter Veentjer

unread,
Oct 3, 2013, 6:28:19 AM10/3/13
to haze...@googlegroups.com
Hi Clement,

your observation is correct, you need to have the network section configured for multicast to be enabled.

This is different compared to when using programmatic configuration where multicast is enabled by default.

So if you use the XML, then you need to explicitly enable multicast.

Peter.


--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
For more options, visit https://groups.google.com/groups/opt_out.

Clément Tamisier

unread,
Oct 3, 2013, 6:49:27 AM10/3/13
to haze...@googlegroups.com
Hi Peter,
Thanks for your reply but i'm a little bit confused.

In XmlConfigBuilder line 172 there is:
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);


that means, using the xml configuration way, we assume that enabled is false (which is not the case using the programmatic way) ?

And in hazelcast-config-3.0.xsd line 339 there is:
<xs:attribute name="enabled" type="xs:boolean" use="optional" default="true"/>


which means that if enabled attribute is not provided the default value is true ?

I have the impression there is a "mismatch" between "XML config" or "Java config" in the default configuration behavior.

Regards.
Clément

Peter Veentjer

unread,
Oct 3, 2013, 6:54:24 AM10/3/13
to haze...@googlegroups.com
Hi Clement,

the XSD part is ignored, and I agree with you that the difference between the XML configuration and the programmatic configuration is a WTF-moment :)

Peter.


--

Clément Tamisier

unread,
Oct 3, 2013, 7:01:34 AM10/3/13
to haze...@googlegroups.com
Do you think a pull request or an issue is justified ? :)

Peter Veentjer

unread,
Oct 3, 2013, 7:29:54 AM10/3/13
to haze...@googlegroups.com, haze...@googlegroups.com
You can give it a try

But there is a reason for this choice, but i dont remember what it was. Either the xsd needs to be fixed, or the difference between xml and programmatic config.

Sent from my iPad

On 3 okt. 2013, at 14:01, Clément Tamisier <clement....@gmail.com> wrote:

Do you think a pull request or an issue is justified ? :)

--
Reply all
Reply to author
Forward
0 new messages