activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <>
Subject Re: messages sent via stomp are not received in ajax client
Date Fri, 09 Jul 2010 21:55:51 GMT

On Jul 9, 2010, at 3:44 PM, Alex Dean wrote:

> On Jul 9, 2010, at 1:50 PM, Alex Dean wrote:
>> I have a Ruby script which publishes a message to an ActiveMQ topic  
>> via Stomp.  I'm attempting to send these messages to the topic used  
>> by the demo chat.html included in ActiveMQ, so I'm using the XML  
>> message format expected by that page.  chat.html is this one :
> My problem appears to be the same one described here :
> Stomp messages which include a content-length header are converted  
> to BytesMessages by ActiveMQ.  Messages without a content-length  
> header are converted to TextMessages.  TextMessages are delivered to  
> JavaScript OK via AJAX, but BytesMessages are not.
> If I hack the Ruby stomp code to not send a content-length header,  
> my Ruby-published messages start appearing in chat.html.  Is there a  
> better way to solve this problem?

For a little more background,  
says that Stomp messages lacking a content-length header are converted  
to JMS TextMessage instances.  Messages containing a content-length  
header are converted to BytesMessage instances. makes no attempt to send a BytesMessage to  
an ajax client, hence the empty message when content-length is present.

See writeMessageResponse in this class:

I'm trying to determine if it's feasible to try to handle BytesMessage  
instances in MessageListenerServlet.  Perhaps via  
BytesMessage.readUTF8()?  I'm not very familiar with ActiveMQ or JMS,  
so I'm not sure what the implications of this might be.


View raw message