powered by Jive Software

Message limit size


How to establish a limit on the size of the message (maximum quantity of symbols) ?



you need to recompile Openfire to set it to another value than 1 MB. It’'s hard coded in XMLLightweightParser.java

// Check that the buffer is not bigger than 1 Megabyte. For security reasons
        // we will abort parsing when 1 Mega of queued chars was found.
        if (buffer.length() > 1048576) {
            throw new Exception("Stopped parsing never ending stanza");


Thank for the answer.

Whether is impossible to do without recompile of Openfire?

No it’‘s not - it’'s either

  1. Recompile


  1. Request a new feature where that value is set in an Openfire parameter, allowing it to customizable. Even if this is accepted as a good idea, it’'ll be far the longest route to take.


If to use plugin “ContentFilter” what should be patterns for the control of length of a line?

I suspect that will pre-process the message, so it’'ll be possible to limit it to less than the hard coded max length, but not increase it.

What offers will be still?

With the help of this method (buffer.length) I cannot limit the size of the message up to 128 bytes.

Only max ,approximately, 1024 bytes.

What to do?


the buffer itself will contain the whole packer with from=… to=… and other things.

If you want to limit the content of the “body” tag to 128 bytes then you should add such a feature to the content filter. The source is included within the Openfire source so it should be quite easy to add it there.


Sorry for question!

How can I compile this plugin?


do you have a setup as described in http://wiki.igniterealtime.org/display/WILDFIRE/BuildOpenfirewith+Eclipse ?

A double click on “plugins” within the Ant window should compile them.


Many thanks for the help!