
We assume that you have already learned what is described in:
If you want to find the right Writer for your purposes, see Writers Comparison.
JMSWriter converts Clover data records into JMS messages.
| Component | Data output | Input ports | Output ports | Transformation | Transf. required | Java | CTL |
|---|---|---|---|---|---|---|---|
| JMSWriter | jms messages | 1 | 0 | yes | no | yes | no |
JMSWriter receives Clover data records,
converts them into JMS messages and sends these messages out.
Component uses a processor transformation which implements a
DataRecord2JmsMsg interface or inherits from a
DataRecord2JmsMsgBase superclass. Methods of
DataRecord2JmsMsg interface are described
below.

| Port type | Number | Required | Description | Metadata |
|---|---|---|---|---|
| Input | 0 | yes | For data records | Any1) |
Legend:
1): Metadata on input port may contain a field specified in the Message body field attribute.
| Attribute | Req | Description | Possible values |
|---|---|---|---|
| Basic | |||
| JMS connection | yes | ID of the JMS connection to be used. | |
| Processor code | Transformation of records to JMS messages written in the graph in Java. | ||
| Processor URL | Name of external file, including path, containing the transformation of records to JMS messages written in Java. | ||
| Processor class | Name of external class defining the
transformation of records to JMS messages. The default
processor value ( | DataRecord2JmsMsgProperties (default) | other class | |
| 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 | |||
| Message body field | Name of the field of metadata from which the body of
the message should be get and sent out. 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 used
as a resource for the body of the message contents. If no
field for the body of the message is contained in metadata
(either the specified explicitly or the default one), the processor
tries to set a field named bodyField, but it's silently ignored
if such field doesn't exist in output record metadata.
The other fields from metadata serve as resources of message
properties with the same names as field names. | bodyField (default) | other name | |
Legend:
1) One of these may be set. Any of these transformation
attributes implements a DataRecord2JmsMsg
interface.
See Java Interfaces for JMSWriter for more information.
See also Defining Transformations for detailed information about transformations.
The transformation implements methods of the DataRecord2JmsMsg interface
and inherits other common methods from the Transform interface.
See Common Java Interfaces.
Following are the methods of
DataRecord2JmsMsg interface:
void init(DataRecordMetadata metadata, Session
session, Properties props)
Initializes the processor.
void preExecute(Session session)
This is also initialization method, which is invoked before each separate graph run.
Contrary the init() procedure here should be allocated only resources for this graph run.
All here allocated resources should be released in the postExecute() method.
session may be used for creation of JMS messages.
Each graph execution has its own session opened.
Thus the session set in the init() method is usable only during the first execution of graph instance.
Message createMsg(DataRecord
record)
Transforms data record to JMS message. Is called for all data records.
Message createLastMsg()
This method is called after last record and is supposed to return message terminating JMS output. If it returns null, no terminating message is sent. Since 2.8.
String getErrorMsg()
Returns error message.
Message createLastMsg(DataRecord
record) (deprecated)
This method is not called explicitly since 2.8. Use
createLastMsg() instead.