StreamBase JMS Configuration File Editor

The JMS Configuration File Editor is a validating XML graphic editor that you can use to create and modify configuration files used by the JMS and EMS input and output adapters. For a complete description of the adapters' functionality, see JMS Input and Output Adapters in the Adapters Guide. For details on configuration file format, see The JMS Embedded Adapters' Configuration File.

Adding a New JMS or EMS Adapter

The editor opens whenever you first create or edit a file with a .jmsconf extension. These configuration files are used by the following adapters:

  • TIBCO StreamBase EMS Reader

  • TIBCO StreamBase EMS Writer

  • TIBCO StreamBase JMS Reader

  • TIBCO StreamBase JMS Writer

Like any adapter, you add these to a StreamBase application by dragging the Adapters, Java Operators icon from the Operators and Adapters palette to your canvas, and then selecting one of them in the Insert an Operator or Adapter dialog, as shown below.

When you click OK, the Adapter Properties tab opens, letting you know that you must specify a configuration file for the adapter. You can:

  • Select an existing configuration file from a drop-down menu

  • Create a new .jmsconf configuration file by clicking the New button

  • Edit an existing configuration file

  • Choose an existing configuration file from a linked project.

The JMS input adapter properties view illustrated below shows these initial choices.

Clicking the New button opens a dialog in which you select a parent folder and provide a filename for the configuration file. In this dialog, you can optionally:

  • Link to an existing .jmsconf file in the file system (after clicking the Advanced button), and

  • Import settings from a TIBCO Businessworks configuration file on your file system. If you select this option, you are prompted to identify one or more files.

When you click Finish, the file you created opens in the JMS configuration file editor. If you selected an existing configuration file, the editor will open it when you click the Edit button in the Adapter Properties view.

For what to do next, see Using the JMS Editor.

Creating a New JMS Configuration File

To create a new JMS configuration file for an existing StreamBase project, right-click on it in the Package Explorer or click the File menu and then select NewOtherJMS Adapter Configuration File.

In the dialog that appears, identify the parent folder the file will occupy, give it a file name (which will automatically be given a .jmsconf extension), and specify the adapter type from a drop-down menu. There are four types: jmsreader, emsreader, jmswriter and emswriter, as shown below.

If you have a JMS configuration file elsewhere in your file system (within or outside your workspace), click the Advanced button and then select Link to file in the file system. Doing this activates the Browse and Variables buttons. Identify an existing .jmsconf file by browsing to its location. Also select or create a path variable to identify the location of the resource by clicking Variables and entering that information on the Select Path Variable dialog.

If you want the configuration to include properties defined in a TIBCO Businessworks ™ application, select Import settings from TIBCO Businessworks. This activates the Next button in the wizard. If you click it, the wizard advances to the Import Configuration Settings screen. Navigate to a Businessworks directory using the Browse button. Select one or more Businessworks configuration files. These files can be any of the following types:

  • *.sharedjmscon

  • *.sharedjndiconfig

  • *.process

  • *.ear

Click Finish. The JMS Editor opens the new file with default contents in a new tab in the Servers/Destinations view.

Using the JMS Editor

The JMS Configuration File Editor opens whenever you create or edit a file with a .jmsconf extension. It provides tabs and forms that enable you to define servers, destinations, connections and mappings.

The editor provides three views you access by clicking the tabs along the bottom of the view:

  • Servers/Destinations view — for configuring servers, destinations, connection types and options. Multiple server configurations can be included in one .jmsconf file. The overall content of this view is toggled by selecting either a server or a destination in its upper left corner, under Servers and Destinations.

  • Field Maps view — in which you map JMS names, headers, and properties to StreamBase fields, and specify timestamp formats.

  • Source view — a standard StreamBase Studio XML validating editor that understands JMS configuration file syntax.

Here is the Servers/Destination view with Server selected, showing the server properties you can set.

Here is the same view with Destination selected. Note that the properties it displays are different.

The Field Maps view (accessed by the Field Maps tab at the bottom of the editor) provides four sets of target lists to declare names for maps and add equivalences between JMS field names and StreamBase field names, as well as format strings for timestamps, as shown below.

In the XML Source view, you can directly edit any element and attribute and add new ones. The XML editor provides content assistance and can propose context-aware suggestions for elements and attributes valid for the current cursor location in the file when you press Ctrl+Space, as show below.

The following sections describe the settings you can make and modify with the editor.

Servers and Destinations Settings: Server

A given JMS configuration is both server- and destination-specific. That is, it presumes communication using a specific JMS provider over a certain connection protocol to exchange messages with a specific destination. The kinds of JMS providers supported are:

  • TIBCO EMS

  • Apache ActiveMQ™

  • IBM WebSphere® Application Server Default JMS

  • Solace

  • Other

A destination is a queue or a topic of interest on a given server. You can designate any number of destinations per server and easily reconfigure the adapter to select one.

Unless you import settings from a TIBCO Businessworks file or clone another JMS configuration file, you must declare at least one server and one destination In the Servers and Destinations area in the upper left corner of the Servers/Destinations view, as shown here for an EMS output adapter configuration.

Use the tool bar at the upper right to add and remove servers and destination, and to test server connections:

  • To add a server or a destination, click the green Plus button and choose Server or Destination. A Server must be present and selected in order to add a destination for it.

  • To remove a server or a destination, select it and click the red X button.

  • To duplicate a server or a destination, select it and click the white Duplicate button.

  • To test a configured server's connection, click the yellow Test Connection button. You receive a report of success or a diagnostic if a connection fails to open.

Each server and each destination within it must have a unique name. When you add a server in the upper left part of the Servers/Destinations view, provide a name for it in the Server Overview section. The following illustration shows a selected EMS server that was given the name EMS_server1 in the Name field and some information about the server and its general content in the Description field. The name and description should be appropriate for the type of server you designate in the JMS Provider pop-up menu.

You can then set destination options for the named server. See Destination Options for a Specified Server for details.

After you select a server type under Server and Destination, you can configure either a JNDI server connection or a direct server connection to it, as described in the following topics.

Server: JNDI Connection Type Options

The Connection Type defaults to JNDI (Java Naming and Directory Interface), as shown below.

The following table describes how the JNDI Connection Type options correspond to <jms-server> attributes and the default values provided.

Option <jms-server> attribute JNDI Default Value
JNDI Context Factory provider-context-factory com.tibco.tibjms.naming.TibjmsInitialContextFactory
JNDI Provider URL provider-url tibjmsnaming://localhost:7222
JNDI Connection Factory connection-factory-name ConnectionFactory

The Advanced JNDI Options, sometimes needed to establish the proper InitialContext for JNDI lookups, Are shown below. They have no defaults.

The following table describes how the Advanced JNDI Options correspond to <jms-server> attributes.

Option <jms-server> attribute JNDI Correspondence or other
Security Principal jndi-security-principal javax.naming.Context.SECURITY_PRINCIPAL
Security Credentials jndi-security-credentials javax.naming.Context.SECURITY_CREDENTIALS
Security Protocol jndi-security-protocol javax.naming.Context.SECURITY_PROTOCOL
DNS URL jndi-dns-url javax.naming.Context.DNS_URL
Initial Context Builder jndi-initial-context-builder Fully-qualified name of the Java class implementing com.streambase.sb.adapter.common.jms.common.JNDIInitialContextBuilder
Security Authentication jndi-security-authentication javax.naming.Context.SECURITY_AUTHENTICATION
Referral jndi-referral javax.naming.Context.REFERRAL
Additional Properties jndi-extra-properties Defines additional properties that may be required beyond those defined in javax.naming.Context
Authoritative jndi-authoritative javax.naming.Context.AUTHORITATIVE

Server: Direct Connection Type Options

When you select a Direct Connection Type, the editor shows the following options:

The following table describes how the Direct Connection Type options correspond to <jms-server> attributes and the default values provided.

Option <jms-server> attribute Default Value
Connection Factory Class connection-factory-class com.tibco.tibjms.TibjmsTopicConnectionFactory
JNDI Provider URL connection-factory-url localhost

You must provide a connection factory class name to instantiate. It is assumed that this class implements a constructor taking one String parameter that represents the URL of the JMS broker, which you must also specify if it is not localhost.

The following table describes the how the Connection Options properties correspond to <jms-server> attributes and gives their interpretations.They are all strings. Specifying any of these settings is optional.

Option <jms-server> attribute Description
Client ID client-id Causes the adapter to call javax.jms.Connection.setClientID() with the supplied value.
Subscriber Name subscriber-name Causes a durable subscription to be made/used with the specified subscriber name. Valid only when used in conjunction with destinations that are Topics.
Username username The username to use when connecting to JMS
Password password The password to use when connecting to JMS
Acknowledge Mode acknowledge-mode The mode that is used to acknowledge JMS messages. Defaults to AUTO_ACKNOWLEDGE. You can also select DUPS_OK_ACKNOWLEDGE, and Tibco's NO_ACKNOWLEDGE.
Connection Builder Class connection-builder The fully-qualified name of a class that implements com.streambase.sb.adapter.common.jms.common. ConnectionBuilderInterface, responsible for creating and initializing JMS Connection objects. If this parameter is not specified, the adapter's default implementation is used.
Custom Settings custom-settings An arbitrary string passed verbatim to the implementer of the CustomConnectionBuilder interface

Server and Destinations Settings: Destination

A destination is a queue or a topic on a particular server. When you select Destination under Server and Destinations, you can profile a destination by giving it a name, configuring a message converter, and specifying field maps for it. Destination settings for input adapters and output adapters differ slightly, and the view changes according to which type you are configuring. Certain properties pertain to all destinations on a server, as the following topic describes.

Destination Options for a Specified Server

As mentioned in Server and Destinations Settings: Server above, each server and each destination within it must have a unique name. After you add a server in the upper left part of the Servers/Destinations view and provide a name for it in the Server Overview section, configure the options common to all destinations on that server in the Destination Options area on the lower left corner of the Servers/Destinations view. These options are illustrated below, showing their defaults.

The following table describes the how the Destination options settings correspond to <jms-server> or <destinations> attributes and gives their interpretations. All have default values.

Option <jms-server> or <destinations> attribute Description
Create Destinations create-destination Boolean. When selected (the default), indicates that destinations should be created. When unselected, look up destinations in JNDI. If supported by the JMS provider, destinations can be created even if they exist. Creating destinations is faster than looking them up in JNDI.
Cache Destinations cache-destinations Boolean. When selected (the default), indicates that destinations should be cached once created. Caching offers better performance. However, if you are creating thousands of destinations, caching them may increase your memory footprint.
Destination Type is-topic Boolean. Indicates whether the destination is a Topic (the default) or a Queue.
Destination Monitor Interval destination-monitor-interval Integer. When non-zero, enables monitoring the health of JMS destinations on a given server at intervals you specify in ms. By default, destinations are not monitored.
Attempt to Reconnect n/a Boolean. By default, JMS adapters only try to connect to a JNDI or JMS server once before giving up. Select this check box to enable retry attempts.
Retry Count server-num-retries Integer. Set the Retry Count combo box value to indicate how many attempts to reconnect the adapter should make before giving up.
Retry Interval server-reconnect-interval Integer. Set the Retry Interval combo box value to indicate how often (in seconds) the adapter should try to reconnect.

Destination Settings for Input Adapters

For JMS and EMS input adapters, the settings you can make for each destination are shown below, for a destination that has been named Input_destination1. Defaults are shown except for the Name Map (see Field Map Settings, below).

The following table describes the how the Destination options correspond to <destination> attributes and gives their interpretations. Only Message Converter and Timestamp Format have default values.

Option Input <destination> attribute Description
Name name A destination is created or looked by name you assign.
Subscriber Name subscriber-name Causes a durable subscription to be made/used with the specified subscriber name. Valid only when used in conjunction with destinations that are Topics.
Message Converter message-to-tuple-converter How a JMS Reader translates message into a tuple and how a JMS Writer translates a tuple into a JMS message. Three message types are supported: MapMessage, TextMessage, and BytesMessage.
Message Selector message-selector The message selector expression (if any) to use for this destination.
Custom Converter Settings converter-custom-settings A literal string passed to the specified Message Converter. It allows implementers to pass arbitrary values to their converter, which is solely responsible for parsing and interpreting this string.
Timestamp Format timestamp-format The string format used by timestamp fields delivered by this destination. Use the drop-down to select a named timestamp format that you previously specified in the Timestamp Formats section of the Field Maps tab view. The default format string is "MM/dd/yyyy hh:mm:ss aa"
Delivery Time Field delivery-time-field The field in the StreamBase tuple that will be marked with a message's delivery time.
Name Map name-map The name map used for this destination. Use the drop-down to select a name map you previously defined on the Field Maps tab view.
Header Map jms-header-map The header map used for this destination. Use the drop-down to select a header map you previously defined on the Field Maps tab view.
Property Map jms-property-map The property map used for this destination. Use the drop-down to select a property map you previously defined on the Field Maps tab view.

The three types of field maps are discussed in the following sections. For additional information on conversions between JMS and EMS messages and StreamBase tuples, see Message Translation.

Destination Settings for Output Adapters

For JMS and EMS output adapters, the settings you can make for each destination are shown below for a destination that has been named Output_destination1. Defaults are shown except for the Name Map (see Field Map Settings, below).

The settings (Name, Message Converter, Custom Converter Settings, and Timestamp Format) mimic those described above in Destination Settings for Input Adapters. The other options differ. The following table describes all the output destination options.

Option Output <destination> attribute Description
Name name A destination is created or looked by name you assign.
Message Converter tuple-to-message-converter How a JMS Reader translates message into a tuple and how a JMS Writer translates a tuple into a JMS message. Three message types are supported: MapMessage, TextMessage, and BytesMessage.
Custom Converter Settings converter-custom-settings A literal string passed to the specified Message Converter. It allows implementers to pass arbitrary values to their converter, which is solely responsible for parsing and interpreting this string.
Timestamp Format timestamp-format The string format used by timestamp fields delivered by this destination. Use the drop-down to select a named timestamp format that you previously specified in the Timestamp Formats section of the Field Maps tab view. The default format string is "MM/dd/yyyy hh:mm:ss aa"
Delivery Mode delivery-mode JMS messages can be delivered via either of two delivery modes, PERSISTENT or NON_PERSISTENT. EMS output adapters have a third one, RELIABLE_DELIVERY.
Time-To-Live time-to-live MS to wait after a message is published before destroying the message if it is not yet delivered.
Message Priority priority Urgency of a message, from 0 (lowest) to 9 (highest). The JMS provider tries to deliver higher-priority messages before lower-priority ones, but this is not guaranteed.
Disable Message ID disable-message-id A JMS provider may be able to reduce message overhead when given a hint that a client does not use message IDs. Select if your application ignores IDs.
Disable Message Timestamp disable-message-timestamp A JMS provider may be able to reduce message overhead when given a hint that a client does not use timestamps. Select if your application ignores timestamps.
Name Map name-map The name map used for this destination. Use the drop-down to select a name map you previously defined on the Field Maps tab view.
Header Map jms-header-map The header map used for this destination. Use the drop-down to select a header map you previously defined on the Field Maps tab view.
Property Map jms-property-map The property map used for this destination. Use the drop-down to select a property map you previously defined on the Field Maps tab view.

For information on conversions between JMS and EMS messages and StreamBase tuples, see Message Translation.

Field Map Settings

JMS messages usually contain name-value pairs that correspond to StreamBase fields, as described in Mapping Names, Headers and Properties. Should any corresponding names differ, you can use the Field Maps tab in the editor to map JMS messages to StreamBase fields. You may also want to define a mapping when a JMS field and a StreamBase field have the same name but different types of content. A new .jmsconf file contains no default Field Map settings.

The Field Maps view lets you enter any number of JMS-to-StreamBase field mappings for:

  • Field Names

  • Headers

  • Properties

In the Timestamp Format section at the bottom of the Field Map view you also can define and name timestamp format strings. The name you give each format shows up as a choice in the Destination Timestamp Format pop-up menu.

Field Name Maps

You can map a field on a MapMessage to a field on a StreamBase schema that has a different name. A set of such mappings is called a Name Map. Name Maps are bi-directional and can contain any number of fields. You can define as many name maps as you need, but only one can be in effect per destination.

Create a new Name Map by clicking the Plus button on the left under Name Maps and entering a name to identify the map. Then, on the field grid to the right, add a row for each mapping. Enter the JMS Field name in the first entry and the corresponding StreamBase field name in the second entry. The following illustration shows a name map with three equivalences.

This particular mapping defines a name map called ambrosia that maps three different JMS fields into the same StreamBase field, called Sweetener. When you save the .jmsconf file, name maps you defined are added as <name-map> elements. The ambrosia name map from the above example adds the following XML, which you see in the Source view:

  <name-maps>
    <name-map name="ambrosia">
      <mapping jms-name="Honey" sb-name="Sweetener"/>
      <mapping jms-name="MapleSyrup" sb-name="Sweetener"/>
      <mapping jms-name="Sugar" sb-name="Sweetener"/>
    </name-map>
  </name-maps>

You select mappings to use in the Field Maps - Destination area of the Destination view, as shown below.

To delete a name map, select its name and click the X button above the field grid. This action cannot be undone.

Header Maps

A JMS message is delivered with a set of standard JMS header fields. Header fields can be mapped to StreamBase fields using a named <jms-header-map> element. You define header maps as you do name maps, by adding a name for each one on the Header Map field grid on the left and providing one or more field equivalences on the right-hand field grid. Each destination you configure can use a different header map.

Note

Some JMS message headers are read-only, which means that a JMS Writer will not be able to change them should a header map specify them. When configuring a JMS Writer, note that only the following headers are mutable:

  • JMSCorrelationID

  • JMSReplyTo

  • JMSType

Attempting to map any other headers for a JMS Writer results in an error. Because the JMS Reader simply reads the JMS headers, all headers can be mapped to StreamBase fields.

To delete a name map, select its name and click the X button above the field grid. This action cannot be undone.

Property Maps

Either a JMS provider or a message creator can add properties to a JMS message. Properties can be thought of as provider- or user-defined headers. You can define maps to associate one or more properties with StreamBase fields. Esch mapped JMS property causes the value of the property to be written to the StreamBase field. Each configured destination can use a different property map. In a configuration file, property maps are named <jms-property-map> elements.

Add and remove property maps in the Property Maps area of the Field Maps view, in the same manner as name and header maps.