blob: 5294179c280b040c0e11df17cc60c143bd7e50d1 [file] [log] [blame]
<div class="wiki-content maincontent"><h2 id="StructuredMessagePropertiesandMapMessages-StructuredMessagePropertiesandMapMessages">Structured Message Properties and MapMessages</h2>
<p>This JMS extension feature allows you to attach Map and List properties to any JMS Message or to use nested Maps and Lists inside a MapMessage. This allows you to efficiently send typesafe structured information in your messages without requiring the overhead of XML/XSD parsing which are parseable in other languages like C, C++, C# etc.</p>
<p>This enhancement allows any Map or List implementation to be used in the value parameter of these JMS methods</p>
<ul><li><a shape="rect" class="external-link" href="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html#setObjectProperty(java.lang.String,%20java.lang.Object)" rel="nofollow">Message.setObjectProperty(key, value)</a></li><li><a shape="rect" class="external-link" href="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MapMessage.html#setObject(java.lang.String,%20java.lang.Object)" rel="nofollow">MapMessage.setObject(key, value)</a></li></ul>
<p>The value can be an arbitrarily nested structure of Maps, Lists and primitive objects (numbers and strings). To give you an idea of the kinds of things you can do you could try looking at these unit test cases</p>
<ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java">NestedMapMessageTest</a></li><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java">NestedMapAndListPropertyTest</a></li></ul></div>