JMS Custom Input Adapter

Adapter type: jms_custom_in. The JMS Custom Input adapter subscribes to custom-formatted Java object messages from a JMS queue or topic, and writes them as stream records.

A custom-provided implementation performs the format conversions of this interface:

package com.sybase.esp.adapters;
public interface ExternalToESPConverter {
	public ESPMessage externalToESP(Serializable externalMessage) throws Exception;
}

Ensure that the objects returned by the externalToESP method implement this interface:

package com.sybase.esp.adapters;
public interface ESPMessage extends Serializable {
	public String getStreamName();
	public String getOpCode();
	public Map<String, Serializable> getColumnValues();
}

The objects returned by the getStreamName, getOpCode, getColumnValues methods are interpreted as the name of the stream to write to, the opcode, and the stream record as a column to message property map value.

Ensure that stream column types correspond to Java classes as follows:

Stream Column Type Java Class
bigdatetime java.lang.Double
binary java.lang.String
boolean java.lang.Boolean
integer java.lang.Integer
interval java.lang.Long
date java.util.Date
float java.lang.Double
long java.lang.Long
money1 java.math.BigDecimal
money2 java.math.BigDecimal
money3 java.math.BigDecimal
money4 java.math.BigDecimal
money5 java.math.BigDecimal
money6 java.math.BigDecimal
money7 java.math.BigDecimal
money8 java.math.BigDecimal
money9 java.math.BigDecimal
money10 java.math.BigDecimal
money11 java.math.BigDecimal
money12 java.math.BigDecimal
money13 java.math.BigDecimal
money14 java.math.BigDecimal
money15 java.math.BigDecimal
string java.lang.String
timestamp java.util.Date

Ensure that implementations of the ExternalToEFSConverter interface provide a constructor with a single argument of java.lang.String type, or a default constructor with no arguments.

Note: Records with unmatched stream names are ignored. Records with null opcodes are interpreted as upserts. The values of non-key columns may be absent or null.

If an implementation is not provided, the default implementation is used, which interprets each external message as an instance of the DefaultEFSMessage class and does not perform a conversion.

Ensure that a Java archive containing an implementation of the ExternalToEFSConverter interface is provided, and place it in the lib subfolder of the Event Stream Processor installation folder.

If you use the CCL ATTACH ADAPTER statement to attach an adapter, you must supply the adapter type.

Note: This adapter supports schema discovery.
Property Label Description
Converter Class Name

Property ID: converterClassName

Type: string

(Required) External to ESP message converter fully qualified class name. No default value.

Connection Factory

Property ID: connectionFactory

Type: string

(Required) Connection factory class name. Consult your third-party vendor documentation for specific formats. Here are some examples:
  • ActiveMQ – ConnectionFactory
  • TIBCO – QueueConnectionFactory
  • WebSphere MQ – MyMQConnFactory
No default value.
JNDI Context Factory

Property ID: jndiContextFactory

Type: string

(Required) Context factory for JNDI context initialization. Consult your third-party vendor documentation for specific formats. Here are some examples:
  • ActiveMQ – org.apache.activemq.jndi.ActiveMQInitialContextFactory
  • TIBCO – com.tibco.tibjms.naming.TibjmsInitialContextFactory
  • WebSphere MQ – com.sun.jndi.fscontext.RefFSContextFactory
No default value.
JNDI URL

Property ID: jndiURL

Type: string

(Required) JNDI URL. Consult your third-party vendor documentation for specific formats. Here are some examples:
  • ActiveMQ – tcp://server:61616
  • TIBCO – tibjmsnaming://server:7222
  • WebSphere MQ – file:/var/mqm/jndi/
WebSphere MQ is different as it requires a separate naming server to be configured with it. By default, WebSphere MQ only provides a file-based naming server. No default value.
Destination Type

Property ID: destinationType

Type: choice

(Required) Destination type. Valid values are:
  • QUEUE
  • TOPIC
Default value is QUEUE.
Destination Name

Property ID: destinationName

Type: string

(Required) Destination name. No default value.

Converter Parameter

Property ID: converterParam

Type: string

(Optional) External to Event Stream Processor message converter start-up parameter. No default value.

Subscription Mode

Property ID: subscriptionMode

Type: choice

(Optional) Specifies the subscription mode for TOPIC. Default value is NONDURABLE. Valid values are DURABLE and NONDURABLE.

Client ID

Property ID: clientID

Type: string

(Optional) Specifies the client identifier for a JMS client. Required for creating a durable subscription. No default value.

Subscription Name

Property ID: subscriptionName

Type: string

(Optional) Specifies a unique name identifying a durable subscription. No default value.

Batch Size

Property ID: batchsize

Type: uint

(Optional) Specifies number of records in a batch to commit in durable subscription mode. Default value is 1.

PropertySet

Property ID: propertyset

Type: string

(Advanced) Specifies the name of the property set. Property sets are reusable sets of properties that are stored in the project configuration file. Using these sets allows you to move adapter configuration properties out of the CCL file and into the CCR file. If you specify the same properties in the project configuration file and the ATTACH ADAPTER statement, the values in the property set override the values defined in the ATTACH ADAPTER statement. No default value.

Date Format

Property ID: dateFormat

Type: string

(Advanced) Date format. Default value is YYYY-MM-DDTHH:MM:SS.SSS.

Timestamp Format

Property ID: timestampFormat

Type: string

(Advanced) Timestamp format. Default value is YYYY-MM-DDTHH:MM:SS.SSS

.

Known limitations:

Related concepts
Guaranteed Delivery