From users-return-25237-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Sep 08 22:27:35 2010 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 47368 invoked from network); 8 Sep 2010 22:27:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 22:27:35 -0000 Received: (qmail 81607 invoked by uid 500); 8 Sep 2010 22:27:35 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 81560 invoked by uid 500); 8 Sep 2010 22:27:34 -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 81552 invoked by uid 99); 8 Sep 2010 22:27:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 22:27:34 +0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_SOFTFAIL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of peterskurt@msn.com does not designate 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 22:27:29 +0000 Received: from joe.nabble.com ([192.168.236.151]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OtT6j-0002cV-72 for users@activemq.apache.org; Wed, 08 Sep 2010 15:27:09 -0700 Date: Wed, 8 Sep 2010 15:27:09 -0700 (PDT) From: petersk To: users@activemq.apache.org Message-ID: <1283984829212-2532135.post@n4.nabble.com> In-Reply-To: <1283981837507-2532079.post@n4.nabble.com> References: <1283981837507-2532079.post@n4.nabble.com> Subject: Re: Just receive text from STOMP in java MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit OK, contrary to some information out there, the jms onMessage as part of Spring will process stomp as a text message. This post is misleading, at best:http://www.apacheserver.net/ActiveMQ-JMS-API-hangs-when-trying-to-start-connection-over-Stomp-at214579.htm Below is an example of my configuration that actually allowed me to see the text message with the listener. {{{ tcp://localhost:9999 stomp://localhost:9998 myBroker manager }}} python code: {{{ #!/usr/bin/env python import stomp import time import logging import sys logging.basicConfig() class MyListener(stomp.ConnectionListener): def on_error(self, headers, message): print('received an error %s' % message) def on_message(self, headers, message): for k,v in headers.iteritems(): print('header: key %s , value %s' %(k,v)) print('received message\n %s'% message) dest='/topic/manager' conn=stomp.Connection([('localhost',9998)]) print('set up Connection') conn.set_listener('somename',MyListener()) print('Set up listener') conn.start() print('started connection') conn.connect(wait=True) print('connected') conn.subscribe(destination=dest, ack='auto') print('subscribed') message='hello cruel world' conn.send(message=message, destination=dest,headers={'type':'a','MessageNumber':21},ack='auto') print('sent message') time.sleep(2) print('slept') conn.disconnect() print('disconnected') }}} I hope this saves someone a bunch of work and searching. -- View this message in context: http://activemq.2283324.n4.nabble.com/Just-receive-text-from-STOMP-in-java-tp2532079p2532135.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.