IBMStreams com.ibm.streamsx.jms Toolkit > com.ibm.streamsx.jms 2.0.0 > com.ibm.streamsx.jms > JMSSource
The JMSSource operator reads data from a WebSphere MQ or an Apache Active MQ queue or a topic and creates tuples from the read data.
The JMSSource operator converts each WebSphere MQ or Apache Active MQ message to a separate tuple and sends it to the output stream. A single message is converted into a single tuple.
The JMSSource operator provides support for SSL via these parameters: sslConnection, keyStore, keyStorePassword and trustStore. When sslConnection is set to true, the keyStore, keyStorePassword and trustStore parameters must be set.
Note: The JMSSource operator configures SSL by setting the JVM system properties via calls to System.property(). Java operators that are fused into the same PE share the same JVM. This implies that any other Java operators fused into the same PE as the JMSSource operator will have these SSL properties set. If this is undesirable, then the JMSSource operator should be placed into it's own PE.
The JMSSource operator can participate in a consistent region. The operator must be at the start of a consistent region.
The operator supports periodic and operator-driven consistent region policies. If the consistent region policy is set as operatorDriven, the triggerCount parameter must be specified. The operator initiates a checkpoint after number of tuples specified by the triggerCount parameter have been processed. If the consistent region policy is set as periodic, the operator respects the period setting and establishes consistent states accordingly.
When a message queue is consumed by multiple message consumers, i.e. multiple JMSSource instances are used to read messages from a same queue, then deterministic routing is required. This requirement can be achieved through the messageSelector parameter. For example, if an SPL application has two JMSSource operator instances and a JMS property named "group" is present on messages that can take value of either 'g1' or 'g2', then each JMSSource operator instance can be assigned in the following manner:
{ param connectionDocument : "/home/streamsuser/connections/JMSconnections.xml"; connection : "amqConn"; access : "amqAccess"; messageSelector : "group = 'g1'"; }
{ param connectionDocument : "/home/streamsuser/connections/JMSconnections.xml"; connection : "amqConn"; access : "amqAccess"; messageSelector : "group = 'g2'"; }
Required: access, connection
Optional: appConfigName, classLibs, codepage, connectionDocument, initDelay, jmsCorrelationIDOutAttributeName, jmsDeliveryModeOutAttributeName, jmsDestinationOutAttributeName, jmsExpirationOutAttributeName, jmsHeaderProperties, jmsHeaderPropertiesOutAttributeName, jmsMessageIDOutAttributeName, jmsPriorityOutAttributeName, jmsRedeliveredOutAttributeName, jmsReplyToOutAttributeName, jmsTimestampOutAttributeName, jmsTypeOutAttributeName, keyStore, keyStorePassword, messageSelector, passwordPropName, period, reconnectionBound, reconnectionPolicy, sslConnection, sslDebug, triggerCount, trustStore, trustStorePassword, userPropName
The JMSSource operator has one mandatory output and one optional output port. If only the mandatory output port is specified, the operator submits a tuple for each message that is successfully read from the messaging provider. The mandatory output port is mutating and its punctuation mode is Free.
The JMSSource operator has one optional output port, which submits tuples when an error occurs.
If both optional and mandatory output ports are specified, the operator submits a tuple to the mandatory port for each message that is read successfully and a tuple to the optional port if an error occurs when reading a message. The tuple submitted to the optional port contains an error message for each message that could not be read successfully. The optional output port has a single attribute of type rstring that contains this error message. The optional output port is mutating and its punctuation mode is Free.
Required: access, connection
Optional: appConfigName, classLibs, codepage, connectionDocument, initDelay, jmsCorrelationIDOutAttributeName, jmsDeliveryModeOutAttributeName, jmsDestinationOutAttributeName, jmsExpirationOutAttributeName, jmsHeaderProperties, jmsHeaderPropertiesOutAttributeName, jmsMessageIDOutAttributeName, jmsPriorityOutAttributeName, jmsRedeliveredOutAttributeName, jmsReplyToOutAttributeName, jmsTimestampOutAttributeName, jmsTypeOutAttributeName, keyStore, keyStorePassword, messageSelector, passwordPropName, period, reconnectionBound, reconnectionPolicy, sslConnection, sslDebug, triggerCount, trustStore, trustStorePassword, userPropName
This mandatory parameter identifies the access specification name.
This parameter specifies the name of application configuration that stores client credential information, the credential specified via application configuration overrides the one specified in connections file.
Allows the user to specify paths to JAR files that should be loaded into the operators classpath. The values of this parameter may point to a specific JAR file, or to a directory. If pointing to a directory, the operator will load all files ending in .jar onto the classpath. If the parameter is set, only its values are used to identify class libraries. If the parameter is not set, the operator falls back to the old implementation referring to environment variables STREAMS_MESSAGING_WMQ_HOME and STREAMS_MESSAGING_AMQ_HOME.
This optional parameter specifies the code page of the target system that is used to convert ustring for a Bytes message type. If this parameter is specified, it must have exactly one value, which is a String constant. If the parameter is not specified, the operator uses the default value of UTF8.
This mandatory parameter identifies the name of the connection specification that contains an JMS element.
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the connection and access parameters. If this parameter is not specified, the operator uses the file that is in the default location ./etc/connections.xml.
Delay in seconds before the operator starts producing tuples.
Output attribute on output data stream to assign JMSCorrelationID to, the specified attribute in output stream must be of type rstring.
Output attribute on output data stream to assign JMSDeliveryMode to, the specified attribute in output stream must be of type int32.
Output attribute on output data stream to assign JMSDestination to, the specified attribute in output stream must be of type rstring.
Output attribute on output data stream to assign JMSExpiration to, the specified attribute in output stream must be of type int64.
Specifies the mapping between JMS Header property values andStreams tuple attributes. The format of the mapping is:
"propertyName1/streamsAttributeName1/typeSpecifier1","propertyName2/streamsAttributeName2/typeSpecifier2","..." ;
Leading and trailing spaces are trimmed from property and
attribute names. The properties can be of the following types:
Type specifier |
Java / Property type |
SPL / Attribute type |
bool |
boolean |
boolean |
byte |
byte |
int8 |
short |
short |
int16 |
int |
int |
int32 |
long |
long |
int64 |
float |
float |
float32 |
double |
double |
float64 |
string |
String |
rstring |
object |
Object |
ustring, uint8, uint16, uint32, uint64 |
If property or attribute type do not match the specified type, an error is logged during operator initialization.
Output attribute on output data stream to assign to the map containing all received properties. The specified attribute in output stream must be of type map<ustring,ustring>.
Output attribute on output data stream to assign JMSMessageID to, the specified attribute in output stream must be of type rstring.
Output attribute on output data stream to assign JMSPriority to, the specified attribute in output stream must be of type int32.
Output attribute on output data stream to assign JMSRedelivered to, the specified attribute in output stream must be of type boolean.
Output attribute on output data stream to assign JMSReplyTo to, the specified attribute in output stream must be of type rstring.
Output attribute on output data stream to assign JMSTimestamp to, the specified attribute in output stream must be of type int64.
Output attribute on output data stream to assign JMSType to, the specified attribute in output stream must be of type rstring.
This parameter specifies the path to the keyStore. If a relative path is specified, the path is relative to the application directory. The sslConnection parameter must be set to true for this parameter to have any effect.
This parameter specifies the password for the keyStore given by the keyStore parameter. The sslConnection parameter must be set to true for this parameter to have any effect.
This optional parameter is used as JMS Message Selector.
This parameter specifies the property name of password in the application configuration. If the appConfigName parameter is specified and the passwordPropName parameter is not set, a compile time error occurs.
This optional parameter specifies the time period in seconds the operator waits before it tries to reconnect. You can use this parameter only when the reconnectionPolicy parameter is specified, otherwise a compile time error occurs. The default value for the period parameter is 60.
This optional parameter specifies the number of successive connections that are attempted for an operator. You can use this parameter only when the reconnectionPolicy parameter is specified and set to BoundedRetry, otherwise a run time error occurs. If the reconnectionBound parameter is specified and the reconnectionPolicy parameter is not set, a compile time error occurs. The default value for the reconnectionBound parameter is 5.
This is an optional parameter that specifies the reconnection policy. The valid values are NoRetry, InfiniteRetry, and BoundedRetry. If the parameter is not specified, the reconnection policy is set to BoundedRetry with a reconnectionBound of 5 and a period of 60 seconds.
This parameter specifies whether the operator should attempt to connect using SSL. If this parameter is specified, then the keyStore, keyStorePassword and trustStore parameters must also be specified. The default value is false.
If SSL/TLS protocol debugging is enabled, all protocol data and information is logged to the console. Use this to debug TLS connection problems. The default is 'false'.
This optional parameter specifies how many messages are submitted before the JMSSource operator starts to drain the pipeline and establish a consistent state. This parameter must be greater than zero and must be set if the JMSSource operator is the start operator of an operatorDriven consistent region.
This parameter specifies the path to the trustStore. If a relative path is specified, the path is relative to the application directory. The sslConnection parameter must be set to true for this parameter to have any effect.
This parameter specifies the password for the trustStore given by the trustStore parameter. The sslConnection parameter must be set to true for this parameter to have any effect.
This parameter specifies the property name of user name in the application configuration. If the appConfigName parameter is specified and the userPropName parameter is not set, a compile time error occurs.
The number of messages that are dropped in the application.
The number of messages that are read successfully from a queue or topic.
The number of reconnection attempts that are made before a successful connection occurs.