Connection specifications document

IBMStreams com.ibm.streamsx.messaging Toolkit > com.ibm.streamsx.messaging 5.4.3 > Connection specifications document

A connection specifications document is an XML document that describes how operators in the Messaging Toolkit connect to and access messaging systems. Each document contains a collection of <connection_specification> elements and <access_specification> elements.

The relationship between connection specifications and access specifications is many-to-many. Operators can connect to the same messaging system (one connection specification) and access several different queues or topics from that service (many access specifications). For example, an operator can connect to a single queue or a single topic in the messaging system.

Alternatively, operators can access equivalent data (one access specification) from several different messaging systems (many connection specifications), for example, accessing data from both a test system and a production system.

When the SPL compiler encounters an operator declaration for an XMSSink and XMSSource operators, the compiler reads the connection specifications document that is named by the connectionDocument parameter for that operator. If this parameter is not specified, the operator looks for a etc/connections.xml file, where the path is relative to the root of the application directory.

The compiler checks that the document conforms to the semantic rules of the XML schema that is defined for these documents. The SPL compiler uses the information that is given in the connection and access specifications to configure the operator. The compiler does not attempt to connect to the messaging system or access its data to verify correct configuration at compile time. The operators have run-time checks to validate configuration; if the configuration is incorrect these checks might result in run time failures, which are captured in the processing element logs.

For MQTTSink and MQTTSource operators, the connection specifications document that is named by connectionDocument parameter contains only a <connection_specification> element. It does not contain an <access_specification> element. The connectionDocument parameter is not mandatory. You can specify the connection information as parameters to the operator.

The JMSSource and JMSSink operators parse the connection specifications document that is named by connectionDocument parameter at run time. If this parameter is not specified, the operator looks for a etc/connections.xml file, where the path is relative to the application root directory directory.

A valid connection specifications document consists of a connections root element which contains one <connection_specifications> element and one <access_specifications> element. These elements serve as containers for the connection specifications and access specifications. Here is an abridged example of a complete connection specifications document, with all <connection_specification> and <access_specification> elements omitted:

<?xml version="1.0" encoding="UTF-8"?>
<st:connections xmlns:st="http://www.ibm.com/xmlns/prod/streams/adapters"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <connection_specifications>
  ...
  </connection_specifications>
  <access_specifications>
  ...
  </access_specifications>
</st:connections>
Connection_specification element
Access_specification element