Re: MapMessages from Python to Java

2009-11-04 Thread ngcdan12
Great thanks for the help. I can send and receive messages from python to java now :). Dan James Casey-2 wrote: > > Hi Dan, > > The code should look like : > > import stomp > > dest='/queue/MQ-X.1234.X-1.RadarTracks' > # [1] > conn = stomp.Connection([('localhost',61616)]) >#

Re: MapMessages from Python to Java

2009-11-02 Thread James Casey
Hi Dan, The code should look like : import stomp dest='/queue/MQ-X.1234.X-1.RadarTracks' # [1] conn = stomp.Connection([('localhost',61616)]) # [2] conn.start() conn.connect() message = {'field1' : 'foo', 'field2' : 'bar'} conn.send(message, destination=dest, headers={'transformatio

Re: MapMessages from Python to Java

2009-11-02 Thread ngcdan12
Hey guys, Thanks for the response. I made a Python script with the above code. import stomp dest='MQ-X.1234.X-1.RadarTracks' conn = stomp.Connection([('stomp:\\localhost',61616)]) conn.start() conn.connect() message = {'field1' : 'foo', 'field2' : 'bar'} conn.send(message, destination=

Re: MapMessages from Python to Java

2009-10-30 Thread Dejan Bosanac
Hi James,. looks great. I was just confused with {'field1' : 'foo', 'field2' : 'bar'} since it looks like JSON notation. Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nigh

Re: MapMessages from Python to Java

2009-10-30 Thread James Casey
Hi Dejan, the stomp.py code only supports this single transformation type at the moment, and turns the python dict into an XML string as follows: def __convert_dict(self, payload): """ Encode python dictionary as ... structure. """ xmlStr = "\n" for key i

Re: MapMessages from Python to Java

2009-10-30 Thread Dejan Bosanac
James, thanks for great example. Shouldn't it be jms-map-json in this example however? Dan, you can also take a look at PHP example here http://stomp.fusesource.org/documentation/php/book.html#_message_transformation Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration -

Re: MapMessages from Python to Java

2009-10-30 Thread James Casey
Hi Dan, for stomp.py, here's the code snippet to do what you need to do: dest='/queue/test.foo' conn = stomp.Connection([(HOST,PORT)]) conn.start() conn.connect() message = {'field1' : 'foo', 'field2' : 'bar'} conn.send(message, destination=dest, headers={'transformation'

Re: MapMessages from Python to Java

2009-10-29 Thread ngcdan12
Hello Dejan, Python is sending mapmessages directly to the MQ server :). I am wondering about the Stomp protocol. The example you listed below is for a Java implementaion of Stomp. I am actually having a problem with the MapMessage being sent from the Python side. So I would need to convert t

Re: MapMessages from Python to Java

2009-10-27 Thread Dejan Bosanac
Hi, are you sure you're sending map messages from Python? If you use Stomp protocol, you have to send your data xml or json encoded and use "transformation" header to specify how data should be converted to Java. I suggest you read this http://cwiki.apache.org/confluence/display/ACTIVEMQ/Stomp#St