8 Replies Latest reply on Apr 23, 2014 12:55 AM by niksw7

    LargeMessages are not fragmented in jgroups-3.2.7.Final.jar

    niksw7

      HelloFrendz,

      I am using jgroups-3.2.7.Final.jar in my project.

      I am sending huge message.If copied to a file its 1.4 MB.

      While sending to other node, I am seeing this error in the logs

       

      2014-04-21 01:46:53,416 ERROR [org.jgroups.protocols.UDP] (ClusterNodeCommMessageWorker-4) failed sending message to cluster (1564701 bytes): java.lang.Exception: message size (1564701) is greater than max bundling size (64000). Set the fragmentation/bundle size in FRAG and TP correctly, cause: null

      msg="Some Xml" //But very large

      JChannel  channel = new JChannel("UDP");

      channel.send(new Message(null, null, msg));

      Can anyone be helpful to rescue me out of this or any pointers.

       

       

      From my understanding what I feel is that the Msg if greater than bundling size, then it shoul fragment it and then send.

      Please let me know if I am misguided here.

       

      Thanks

      Niks

        • 1. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
          belaban

          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

            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

              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

                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

                  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

                    ooh 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.

                    1 of 1 people found this helpful
                    • 7. Re: LargeMessages are not fragmented in jgroups-3.2.7.Final.jar
                      belaban

                      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

                        Ya...

                        Thanks I will follow this and check if its possible to include jboss Udp Stack.