You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by habumaster <ph...@ericsson.com> on 2011/01/27 17:25:19 UTC

ActiveMQ "message" defined?? from the docs/web links

"3.	A HTTP response is returned to the client containing all available
messages encapsulated as text/xml"

How does AMQ decide that messages are separate in a stream received?

Does it key off line breaks "\n" or what 

A single Message is getting split into multiple messages, so I get multiple
ones returned.
 
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-message-defined-from-the-docs-web-links-tp3242535p3242535.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ "message" defined?? from the docs/web links

Posted by habumaster <ph...@ericsson.com>.

Alex Dean-2 wrote:
> 
> 
> On Jan 27, 2011, at 10:25 AM, habumaster wrote:
> 
>> 
> That sounds like a bug.  Can you reproduce it reliably?  What does the
> original message look like, how do you send it to the broker
> (stomp,ajax,other?), and what does the browser see when the messages are
> received?
> 
> alex
> 
> 

We found the problem. We have embedded HTML in the XML that is returned to
parse.

using a ruby script with Stomp to insert the message

Good:
data = "Element.insert(\"chat_message_list_71\", { bottom: \"Dave\"})" 

Bad:
data = "Element.insert(\"chat_message_list_71\", { bottom:
\"<li>Dave<\li>\"})"

Note the <li><\li>


I figured it out :)


data = "<![CDATA[Element.insert(\"chat_message_list_70\", { bottom:
\"<li>Dave<\li>\"})]]>"

Good ole CDATA.........

<![CDATA[ "your escaped content"]]>

Phil
   


-- 
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-message-defined-from-the-docs-web-links-tp3242535p3245580.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ "message" defined?? from the docs/web links

Posted by Alex Dean <al...@crackpot.org>.
On Jan 27, 2011, at 10:25 AM, habumaster wrote:

> 
> "3.	A HTTP response is returned to the client containing all available
> messages encapsulated as text/xml"
> 
> How does AMQ decide that messages are separate in a stream received?

Which part of ActiveMQ are you referring to?  The broker will get separate messages from publishers, and as far as I know it won't ever split one message into several.  AjaxServlet sends messages to the browser in some XML packaging, which is used by amq.js to decide which callback function to pass each message to.

  <ajax-response>
    <response id='handlerA' destination='queue://testA' >message on queue A</response>
    <response id='handlerB' destination='queue://testB' >message on queue B</response>
  </ajax-response>

This is how the messages look in transit between AjaxServlet and amq.js.  amq.js will call handlerA() for the first message, and handlerB() for the second message.

> 
> Does it key off line breaks "\n" or what 
> 
> A single Message is getting split into multiple messages, so I get multiple
> ones returned.

That sounds like a bug.  Can you reproduce it reliably?  What does the original message look like, how do you send it to the broker (stomp,ajax,other?), and what does the browser see when the messages are received?

alex