Take a look at the Message Transformation section of the ActiveMQ Stomp support page, which shows how an XML object (also works with JSON) can be sent to an ActiveMQ broker and converted to a Java object. You can also register and create your own Transformation class if you do not want to use XML or JSON.
source share