Configuring the JMS adapter
Use the JMSAdapter.xml configuration file to configure the JMS adapter to send and receive messages with destinations on a JMS server.
The format of the JMSAdapter.xml configuration file is the same whether you run it within the Diffusion™ server or as a standalone client. However, the server-connection element and child elements are only used when the JMS adapter is run as a standalone client. If the server-connection element is included in a JMSAdapter.xml configuration file used when the JMS adapter runs within the Diffusion server, the JMS adapter ignores the element.
The JMSAdapter.xml and the JMSAdapter.xsd schema file that describes its format are available in the adapters/jms directory of the Diffusion installation. For more information, see JMSAdapter.xml.
- The JMS provider to connect to.
For more information, see Example: Configuring JMS providers for the JMS adapter.
- The Diffusion topics to create and use.
For more information, see Example: Configuring topics for use with the JMS adapter.
- The JMS destinations to subscribe to and the Diffusion topics to publish data from the JMS
destination to.
For more information, see Example: Configuring pub-sub with the JMS adapter.
- How messages are sent between Diffusion clients
and JMS destinations through Diffusion topics.
For more information, see Example: Configuring messaging with the JMS adapter.
- A request-response message flow.
For more information, see Example: Configuring the JMS adapter to work with JMS services.
Configuring the JMS adapter to run within the Diffusion server
The JMS adapter running inside the Diffusion server uses the JMSAdapter.xml configuration file that is located in the adapters directory of the Diffusion installation.
When running inside the Diffusion server, the JMS adapter polls the JMSAdapter.xml file at five second intervals. If the timestamp changes in that interval, the JMS adapter reloads the configuration file.
- If the topic configuration is not changed, the topic is not changed on the Diffusion server.
- If a topic configuration is added, that topic is added on the Diffusion server.
- If a topic configuration is removed, that topic is deleted from the Diffusion server.
- If a topic configuration is changed – for example, if its definition is changed from stateful to stateless – that topic is deleted from the Diffusion server and a new topic is created at the same path.
- Back up your original configuration file. For example, by moving it to
JMSAdapter.xml.bak.
If a configuration file is not present, the JMS adapter continues to use its current configuration.
- Do not copy the new configuration file into place. Use a move operation instead. Move operations are atomic and remove the risk of the JMS adapter reading an incomplete file.
- In a production environment, rigorously test any new configuration file before deploying on a production server.
If the new configuration file contains an error, the configuration changes it contains are not applied. Instead the configuration rolls back to the original version and an error is logged.
Configuring the JMS adapter to run as a standalone client
When running as a standalone client, the JMS adapter uses the JMSAdapter.xml configuration file that is passed to the jms_adapter.sh or jms_adapter.bat file used to start the JMS adapter.
The JMS adapter standalone client loads the JMSAdapter.xml file only once, when the JMS adapter is started. To update the configuration used by the JMS adapter, edit the JMSAdapter.xml file and restart the JMS adapter.
Topics created by the JMS adapter when it runs as a standalone client remain on the Diffusion server after the JMS adapter session closes.
The server-connection element of the JMSAdapter.xml configuration file is used by the standalone client version of JMS adapter to define the connection that the JMS adapter makes to the Diffusion server. For more information, see Example: Configuring the Diffusion connection for the JMS adapter running as a standalone client.