Connecting Apama Applications to External Components > Using Message Services > Using Correlator-Integrated Messaging for JMS > JMS configuration reference > XML configuration file format
XML configuration file format
The correlator-integrated messaging for JMS configuration files use the Spring XML file format, which provides an open-source framework for flexibly wiring together the difference parts of an application, each of which is represented by a bean. Each bean is configured with an associated set of properties, and has a unique identifier which can be specified using the id= attribute.
For example:
<bean id="globalReceiverSettings"
class="com.apama.correlator.jms.config.JmsReceiverSettings">
<property name="logJmsMessages" value="true"/>
<property name="logProductMessages" value="false"/>
</bean>
Or:
<jms:receiver id="myReceiver1">
<property name="destination" value="queue:SampleQ1"/>
</jms:receiver>
It is not necessary to have a detailed knowledge of Spring to configure correlator-integrated messaging for JMS, but some customers may wish to explore the Spring 3.0.5 documentation to obtain a deeper understanding of what is going on and to leverage some of the more advanced functionality that Spring provides.
The key beans making up the Apama configuration are jms:connection, jms:receiver and jms:sender, plus additional beans that are usually stored in the jms-global-spring.xml file and shared across all configured connections, such as the reliable receive database and the advanced sender/receiver settings beans.
Bean ids
All receiver, sender, connection, and other configuration beans have an "id=" attribute that specifies a unique identifier. These identifiers are used in log messages, when monitoring status from EPL applications, and, when necessary, for references between different Spring beans in the XML configuration files. It is important that all identifiers are completely unique, for example the same id cannot be used for senders and receivers in different connections, or for both a sender and a receiver, even if they located in different XML files.
Setting property values
Most bean properties have primitive values (such as string, number, boolean) which are set like this:
<property name="propName" value="my value"/>
However, there are also a few properties that reference other beans, such as the reliableReceiveDatabase property on jms:connection and the receiverSettings property on jms:receiver. These property values can be set by specifying the id of a top-level bean like this (where it is assumed that globalReceiverSettings is the id of a JmsReceiverSettings bean):
<property name="receiverSettings" ref="globalReceiverSettings"/>
Any top-level bean may be referenced in this way, that is, any bean that is a child of the <beans> element and not nested inside another bean. Referencing a bean that is defined in a different configuration file is supported, and the jms-global-spring.xml file is intended as a convenient place to store top-level beans that should be shared across many different JMS connections.
Instead of referencing a shared bean, it is also possible to configure a bean property by creating an 'inner' configuration bean nested inside the property value like this:
<property name="receiverSettings">
<bean class="com.apama.correlator.jms.config.JmsReceiverSettings">
<property name="logJmsMessages" value="true"/>
</bean>
</property>
(Note, advanced users may want to exploit Spring's property inheritance by using the parent= attribute on an inner bean to inherit most properties from a standard top-level bean while overriding some specific subset of properties or by type-based 'auto-wiring' - any non-primitive property of jms:connection/receiver/sender for which no value is explicitly set will implicitly reference a top-level bean of the required type. This is how jms:connection beans get a reference to the reliableReceiveDatabase and defaultSender/ReceiverSettings beans. Most configuration can just ignore this detail and use the automatically wired property values, and the bean representing the Apama-provided mapper, but if desired the defaults for individual connections/senders/receivers can be customized independently of each other by specifying the property values explicitly.)
Adding static senders and receivers
For simple cases where detailed configuration of receivers is not required, it is possible to configure static receivers using a simple semicolon-delimited list of JMS destinations, for example:
<property name="staticReceiverList"
value="topic:MyTopic;jndi:/sample/some-jndiqueuename" />
The staticReceiverList bean property is represented by a placeholder in the connectionId-spring.properties file, and can be edited using Apama Studio.
For more advanced receiver configuration, it is necessary to edit the connectionId-spring.xml file manually, and provide a list of jms:receiver beans as the value of the staticReceivers property:
<property name="staticReceivers">
<list>
<jms:receiver id="myReceiver1">
<property name="destination"
value="queue:SampleQ1"/>
</jms:receiver>

<jms:receiver id="myReceiver2">
<property name="destination"
value="jndi:/sample/my-jndi-topic-name"/>
<property name="durableTopicSubscriptionName"
value="MyTopicSubscription"/>
</jms:receiver>
</list>
</property>>
Senders may be configured in the same way, for example:
<property name="staticSenders">
<!-- each static sender results in a correlator channel
called "jms:senderId" -->
<list>
<jms:sender id="MyConnection-default-sender">
</jms:sender>

<jms:sender id="myReliableSender">
<property name="senderReliability" value="EXACTLY_ONCE"/>
</jms:sender>

<jms:sender id="myUnreliableSender">
<property name="senderReliability" value="BEST_EFFORT"/>
</jms:sender>
</list>
</property>
If a sender list is not explicitly configured, a single sender with id connectionId-default-sender will be created.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.