From users-return-24973-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Tue Aug 17 21:13:23 2010 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 6050 invoked from network); 17 Aug 2010 21:13:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Aug 2010 21:13:23 -0000 Received: (qmail 22650 invoked by uid 500); 17 Aug 2010 21:13:22 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 22583 invoked by uid 500); 17 Aug 2010 21:13:22 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 22570 invoked by uid 99); 17 Aug 2010 21:13:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Aug 2010 21:13:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [165.236.161.2] (HELO imail.meteostar.com) (165.236.161.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Aug 2010 21:13:17 +0000 Received: from localhost (localhost [127.0.0.1]) by imail.meteostar.com (Postfix) with ESMTP id 27F75CF2CB9 for ; Tue, 17 Aug 2010 15:12:57 -0600 (MDT) X-Virus-Scanned: amavisd-new at meteostar.com Received: from imail.meteostar.com ([127.0.0.1]) by localhost (imail.meteostar.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FqHU7MZXKT7O for ; Tue, 17 Aug 2010 15:12:56 -0600 (MDT) Received: from [192.168.1.123] (unknown [98.159.191.254]) by imail.meteostar.com (Postfix) with ESMTPSA id C6FAFCF2CAE for ; Tue, 17 Aug 2010 15:12:55 -0600 (MDT) Message-Id: From: Alex Dean To: users@activemq.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: messages sent via stomp are not received in ajax client Date: Tue, 17 Aug 2010 16:12:52 -0500 References: <16F3658C-910D-46D4-BB83-8CDCFE2C3D63@meteostar.com> <1F6E1128-D236-41B2-A911-3690C1C68655@meteostar.com> <3C008461-FE1E-42A2-AB08-6AC4834FC07B@meteostar.com> X-Mailer: Apple Mail (2.936) As a followup: We were looking over the release notes for AMQ 5.4 today, and a co-worker noticed https://issues.apache.org/activemq/browse/AMQ-2833 . This allows Stomp clients to indicate text vs byte messages via a new custom Stomp header. This is perfect for our situation, and we're looking forward to a 5.4 upgrade in the near future. alex On Jul 12, 2010, at 12:48 AM, Dejan Bosanac wrote: > Hi Alex, > > I think it's a bigger problem to pass and handle byte[] content in > JavaScript. All patches are welcomed, of course :) > > Cheers > -- > Dejan Bosanac - http://twitter.com/dejanb > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > > > > On Fri, Jul 9, 2010 at 11:55 PM, Alex Dean > wrote: >> >> 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 : >>>> http://fisheye6.atlassian.com/browse/activemq/branches/activemq-5.3/activemq-web-demo/src/main/webapp/chat.html?r=HEAD >>> >>> My problem appears to be the same one described here : >>> http://juretta.com/log/2009/05/24/activemq-jms-stomp/ >>> >>> 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, http://activemq.apache.org/stomp.html >> 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. MessageListenerServlet.java >> 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: >> http://fisheye6.atlassian.com/browse/activemq/branches/activemq-5.3/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java?r=HEAD >> >> 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. >> >> thanks, >> alex >>