3 Replies Latest reply on Dec 19, 2003 9:53 PM by dafei

    size limit on (text) message

    dafei

      i have a new jms app using jboss, and am having out of memory problem when publishing a string message to a topic. the string message is about 2 mg, which is not too big and i feel it should not throw an outof memory exception. i wonder if there is some settings in jboss that i can adjust on how big a message can be processed in jboss.

      thank you in advance.

        • 1. Re: size limit on (text) message
          xs2iop

          Hi, I have the same error with an object message,
          have you found a solution?
          regards Sébastien
          xs2iop@yahoo.fr

          • 2. Re: size limit on (text) message
            tesuji

            This is a known problem. The limit for a text-message is 64Kb. Don't ask me why.

            There's an easy workaround, use StreamMessage instead of TextMessage:

            StreamMessage message = topicSession.createStreamMessage();
            message.writeInt(msg.length());
            message.writeBytes(msg.getBytes());
            publisher = topicSession.createPublisher(topic);
            publisher.publish(message);

            Where 'msg' is a String containing the message you'd like to send.

            • 3. Re: size limit on (text) message
              dafei

              i added some memory to jboss using -Xmx today, and it went through with no problem. the file is 2.6 mb to 3.5 mb. i believe much bigger text files can go thru if more memory is added using -Xmx.