-
1. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
belaban Apr 21, 2014 12:46 PM (in response to niksw7)Do you have a fragmentation protocol (FRAG or FRAG2) in your config ?
-
2. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
niksw7 Apr 22, 2014 1:21 AM (in response to belaban)Yes Sir,
I do have FRAG2 in my config .
I am using this with Jboss 7.2
-
3. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
belaban Apr 22, 2014 1:23 AM (in response to niksw7)Please provide a small program which reproduces this. It still looks as if the message is not fragmented at all, and FRAG{2} is bypassed...
-
4. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
niksw7 Apr 22, 2014 9:25 AM (in response to belaban)Well reproducing this issue is quite simple.
We just need to send a message which is over 64kB (UDP max size)
Narrowing to a sample test program from production site, this is what if it helps.
//Code to RUN
String str ="<Sample><rely>false</rely><state>XYZZ</state><nodeIp>10.4.167.27</nodeIp><key>10.4.167.27</key> <value class=\"map\">";
int count =15000; //random count
String hugeString="";
for(int i =0;i<count;i++){
hugeString +=hugeString ;//should be more than 64kB
}
//So here we send the message.
JChannel channel = new JChannel("UDP");
channel.setReceiver(somereciever or this object);
channel.connect(System.getProperty("jboss.partition.name", HaUtil.getMY_IP()));
channel.send(new Message(null, null,hugeString));
}
//my UDP stack looks like this in standalone-full-ha.xml
<subsystem xmlns="urn:jboss:domain:jgroups:1.1"
default-stack="udp">
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp" />
<protocol type="PING" />
<protocol type="MERGE3" />
<protocol type="FD_SOCK" socket-binding="jgroups-udp-fd" />
<protocol type="FD" />
<protocol type="VERIFY_SUSPECT" />
<protocol type="BARRIER" />
<protocol type="pbcast.NAKACK2" />
<protocol type="UNICAST2" />
<protocol type="pbcast.STABLE" />
<protocol type="pbcast.GMS" />
<protocol type="UFC" />
<protocol type="MFC" />
<protocol type="FRAG2" />
<protocol type="RSVP" />
</stack>
If i toggle the flag of DONT_BUNDLE to true while sending the message , then the message is received on the other node,
but still I see error in logs saying:
2014-04-22 05:01:45,203 ERROR [org.jgroups.protocols.UDP] (http-/0.0.0.0:80-6) failed sending message to cluster (604967 bytes): java.lang.Exception: dest=/228.8.8.8:7600 (604970 bytes), cause: java.io.IOException: Message too long
I am really confused as to why the message is not getting fragmented before sending
----Thanks
-
5. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
belaban Apr 22, 2014 10:32 AM (in response to niksw7)First of all, your new JChannel("UDP") constructor will *not* reference the stack defined in JBoss as "udp", but instead it will create a stack with *one protocol only, namely UDP. This means there is no fragmentation protocol.
Second, in the code above, the length of hugeString will be 0. I assume you wanted to assign str to hugeString initially ?
-
6. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
niksw7 Apr 22, 2014 11:29 AM (in response to belaban)1 of 1 people found this helpfulooh Cool,
Thanks a lot for pointing this out, It was like a shot in the arm
I changed the code to
JChannel channel = new JChannel("udp.xml");
And it now works perfectly.
Any idea as to how to refer the udp stack in standalone-full-ha.xml. As of now I suppose it's referring to Jgroups.jar's udp.xml(let me know if I am misunderstanding)
Sorry for that empty hugeString. Yes I wanted to assign it to str.
-
7. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
belaban Apr 22, 2014 12:38 PM (in response to niksw7)Note that doubling hugeString 15000 times will likely run your machine into the ground :-)
I don't think you can refer to the config directly, but you can refer to the created channel, check out the links below:
Using jgroups CounterService with jboss's cluster channel
Accessing JGroups Channels Within a JBoss 7 Application
http://piotrnowicki.com/2013/02/using-jgroups-directly-from-jboss-as-7-component/
-
8. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
niksw7 Apr 23, 2014 12:55 AM (in response to belaban)Ya...
Thanks I will follow this and check if its possible to include jboss Udp Stack.