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)])
>#
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
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=
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
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
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 -
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'
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
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