How to use JMS Message Transformation in ActiveMQ with Stomp/JSON

The only format accepted by the transformation jms-map-json or jms-object-json is a simple Map format, which in JSON is:

{"map" : 
  {"entry" : 
    [ 
      { "string1": [ "key1", "value1" ] },
      { "string2": [ "key2", "value2" ] }
    ]
  }
}

This is the same format shown in the discussion forum. This format represents a name/value pair map object in java.

Selectors are only usable on Properties and Headers.


you can use any JSON notation for your jms-object-json transformations as long as XStream can handle it. You can take a look at test cases for some examples. There, we use SamplePojo class:

https://svn.apache.org/repos/asf/activemq/trunk/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/SamplePojo.java

which is properly annotated so it can be represented with the following JSON

{"pojo":{ "name":"Dejan", "city":"Belgrade" }}

You can try using the same approach for your classes.

Hope this helps, Dejan