[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1802) Sending MapMessage with large String value is broken

Howard Gao (JIRA) jira-events at lists.jboss.org
Thu Apr 22 09:09:11 EDT 2010


    [ https://jira.jboss.org/jira/browse/JBMESSAGING-1802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12527032#action_12527032 ] 

Howard Gao commented on JBMESSAGING-1802:
-----------------------------------------

I see why...

The DataOutputStream.writeUTF(.)'s java doc says

First, two bytes are written to the output stream as if by the writeShort method giving the number of bytes to follow. ...

That means this method can only support up to 65535 characters. 

To support larger messages, JBM has a org.jboss.messaging.util.SafeUTF helper class. However, this class only supports TextMessage and ObjectMessage. See the class' comment:

/**
 * 
 * A SafeUTF
 * 
 * @author <a href="tim.fox at jboss.com">Tim Fox</a>
 * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
 * @version $Revision: 1174 $
 *
 * $Id: SafeUTF.java 1174 2006-08-02 14:14:32Z timfox $
 * 
 * There is a "bug" in JDK1.4 / 1.5 DataOutputStream.writeUTF()
 * which means it does not work with Strings >= 64K serialized size.
 * See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4806007
 * 
 * We work around this by chunking larger strings into smaller pieces.
 * 
 * Note we only support TextMessage and ObjectMessage bodies with serialized length >= 64K
 * We DO NOT support Strings written to BytesMessages or StreamMessages or written as keys or values
 * in MapMessages, or as String properties or other String fields having serialized length >= 64K
 * This is for performance reasons since there is an overhead in coping with large
 * Strings
 * 
 */

So, I think it's a limit and I would change this JIRA to be feature request.



> Sending MapMessage with large String value is broken
> ----------------------------------------------------
>
>                 Key: JBMESSAGING-1802
>                 URL: https://jira.jboss.org/jira/browse/JBMESSAGING-1802
>             Project: JBoss Messaging
>          Issue Type: Bug
>    Affects Versions: 1.4.0.SP3.CP10, 1.4.6.GA
>            Reporter: Justin Bertram
>            Assignee: Howard Gao
>             Fix For: 1.4.0.SP3.CP11, 1.4.6.GA.SP1
>
>
> Sending a javax.jms.MapMessage that has a String value >= 65536 characters fails.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list