We assume that you have already learned what is described in:
If you want to find the right Reader for your purposes, see Readers Comparison.
JMSReader converts JMS messages into CloudConnect data records.
Component | Data source | Input ports | Output ports | Each to all outputs1) | Different to different outputs2) | Transformation | Transf. req. | Java | CTL |
---|---|---|---|---|---|---|---|---|---|
JMSReader | jms messages | 0 | 1 | yes | no | yes | no | yes | no |
Legend
1) Component sends each data record to all connected output ports.
2) Component sends different data records to different output ports using return values of the transformation. See Return Values of Transformations for more information.
JMSReader receives JMS messages, converts
them into CloudConnect data records and sends these records to the connected
output port.
Component uses a processor transformation which implements a
JmsMsg2DataRecord
interface or inherits from a
JmsMsg2DataRecordBase
superclass. Methods of
JmsMsg2DataRecord
interface are described
below.
Port type | Number | Required | Description | Metadata |
---|---|---|---|---|
Output | 0 | yes | For correct data records | Any1) |
Legend:
1): Metadata on the output port may contain a field specified in the Message body field attribute. Metadata can also use Autofilling Functions.
Attribute | Req | Description | Possible values |
---|---|---|---|
Basic | |||
JMS connection | yes | ID of the JMS connection to be used. | |
Processor code | 1) | Transformation of JMS messages to records written in the graph in Java. | |
Processor URL | 1) | Name of external file, including path, containing the transformation of JMS messages to records written in Java. | |
Processor class | 1) | Name of external class defining the transformation of
JMS messages to records. The default processor value is
sufficient for most cases. It can process both
javax.jms.TextMessage and
javax.jms.BytesMessage . | JmsMsg2DataRecordProperties (default) | other class |
JMS message selector | Standard JMX "query" used to filter the JMS messages that should be processed. In effect, it is a string query using message properties and syntax that is a subset of SQL expressions. See http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html for more information. | ||
Processor source charset | Encoding of external file containing the transformation in Java. | ISO-8859-1 (default) | other encoding | |
Message charset | Encoding of JMS messages contents. This attribute is
also used by the default processor implementation
(JmsMsg2DataRecordProperties ). And it is
used for javax.jms.BytesMessage
only. | ISO-8859-1 (default) | other encoding | |
Advanced | |||
Max msg count | Maximum number of messages to be received. 0 means without limitation. See Limit of Run for more information. | 0 (default) | 1-N | |
Timeout | Maximum time to receive messages in milliseconds. 0 means without limitation. See Limit of Run for more information. | 0 (default) | 1-N | |
Message body field | Name of the field to which message body should be
written. This attribute is used by the default processor
implementation
(JmsMsg2DataRecordProperties ). If no
Message body field is specified, the
field whose name is bodyField will be
filled with the body of the message. If no field for the body
of the message is contained in metadata, the body will not be
written to any field. | bodyField (default) | other name |
Legend:
1) One of these may be set. Any of these transformation
attributes implements a JmsMsg2DataRecord
interface.
See Java Interfaces for JMSReader for more information.
See also Defining Transformations for detailed information about transformations.
It is also important to decide whether you want to limit the number of received messages and/or time of processing. This can be done by using the following setting:
Limited Run
If you specify the maximum number of messages (Max msg count), the timeout (Timeout) or both, the processing will be limited by number of messages, or time of processing, or both of these attributes. They need to be set to positive values.
When the specified number of messages is received, or when the process lasts some defined time, the process stops. Whichever of them will be achieved first, such attribute will be applied.
Note | |
---|---|
Remember that you can also limit the graph run by using
the |
Unlimited Run
On the other hand, if you do not specify either of these two attributes, the processing will never stop. Each of them is set to 0 by default. Thus, the processing is limited by neither the number of messages nor the elapsed time. This is the default setting of JMSReader.
The transformation implements methods of the JmsMsg2DataRecord
interface
and inherits other common methods from the Transform
interface.
See Common Java Interfaces.
Following are the methods of
JmsMsg2DataRecord
interface:
void init(DataRecordMetadata metadata, Properties
props)
Initializes the processor.
boolean endOfInput()
May be used to end processing of input JMS messages when it
returns false
. See Limit of
Run for more
information.
DataRecord extractRecord(Message
msg)
Transforms JMS message to data record.
null
indicates that the message is not accepted by the processor.
String getErrorMsg()
Returns error message.