activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: MapMessages from Python to Java
Date Tue, 27 Oct 2009 09:43:18 GMT
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#Stomp-Messagetransformationsand
look at StompTest (
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?view=markup)
for some more examples.

You can also use py-activemq (http://code.google.com/p/pyactivemq/) lib
which can use OpenWire and CMS API to send map messages naturally.

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 Tue, Oct 27, 2009 at 2:04 AM, ngcdan12 <gameoperative2@hotmail.com>wrote:

>
> Hello,
>
> I have a seperate application that was made in python that is currently
> using Active Mq to send map messages to a ACtive MQ server with a topic.  I
> then have another application written in java that has a message listener
> set up to receive messages from the same topic.  Now i have tested the
> Active Mq with pure java and I am able to send and receive mapMessages, and
> read their contents no problem with JMS API methods.  But when the python
> app uses active mqs built in methods to create a map message, and sends it
> to the server, I receive something, but am unable to read the contents of
> the message.  When I do something like a getString("marking") on the map
> message it comes up empty from the java side.
>
> So long problem short, problem is I can't read the mapMessage the Python
> app
> is sending out on my Java app.
>
> Thanks for any help you can provide.
>
> Here is a code snibbet of the python mapMessage
>
>        jmsMsg.setString("idString", msg.idStr)
>        jmsMsg.setString("typeString", msg.typeStr)
>        jmsMsg.setInt("marking", msg.site)
>        jmsMsg.setInt("app", msg.app)
>
> Here is the code snibbet of my Java message listener
>
> private class ExListener implements MessageListener
>    {
>        public void onMessage(Message msg)
>        {
>        MapMessage mapMsg = (MapMessage) msg;
>        try{System.out.println("getText() "+mapMsg.getString("marking"));
>        }catch(JMSException e) {}
>        }
>    }
>
>
> --
> View this message in context:
> http://www.nabble.com/MapMessages-from-Python-to-Java-tp26070536p26070536.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message