Uploaded image for project: 'ActiveMQ Apollo (Retired)'
  1. ActiveMQ Apollo (Retired)
  2. APLO-355

Stomp Websocke example doesn't work for utf-8 String

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7
    • 1.7.1, 1.8
    • apollo-stomp
    • None
    • apache-apollo-1.7
      linux debian testing
      iceweasel 24.4.0 chromium 33.0.1750.152

    Description

      when I send a utf-8 String to Char Room , it not receive what I send , for example:

      I send : 你好

      the Debug Log is :

      >>> SEND
      destination:/topic/chat.general
      content-length:2

      你好
      <<< MESSAGE
      subscription:sub-0
      message-id:apollo-broker-312
      destination:/topic/chat.general
      content-length:2

      `}

      I receive '`}' not '你好'

      then , I found the content-length is not correct in utf-8 ,in utf-8 '你好' has 6 byte .

      then I change the js/stomp.js to use https://github.com/jmesnil/stomp-websocket

      I see the Debug Log is :

      >>> SEND
      destination:/topic/chat.general
      content-length:6

      你好

      the content-length is correct , but I didn't receive any message .
      after a while , the Debug Log show me :

      <<< ERROR
      message:Expected null terminator after 6 content bytes

      Whoops! Lost connection to ws://localhost:61623/

      Attachments

        Activity

          People

            chirino Hiram R. Chirino
            cctvfly leiqin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: