JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS JMS Reference     Java CAPS Documentation
search filter icon
search icon

Document Information

Java CAPS JMS Reference

Introduction to JMS

JMS and Java CAPS

Java Message Service

JMS Message Servers

JMS Message Destinations

JMS Clients

JMS Object Type Definitions

JMS Library File

Implementing JMS in Java CAPS Projects

Integration Model

To Implement JMS Following the Java CAPS Model

Creating and Configuring Message Destinations

Creating OTDs and Collaborations

Configuring JMS Clients

Configuring Message Servers

Creating Component Mappings

Using the JMS OTD in Collaboration Definitions

Using JMS Messages in Collaboration Definitions

Inside the JMS IQ Manager

JMS Messaging Features

Message Delivery Order

Message Producer Priorities

Distributed Transactions

Security

Runtime Management

JMS IQ Manager Database

Database Files

Database Location

Database Configuration and Operation

Message Processing Order

JMS IQ Manager Delivery Modes

Fully Concurrent Processing

Protected Concurrent Processing

Fully Serialized Processing

Serial Processing Across a Destination Group

JMS Client Delivery Modes

Message Producer Priorities

Message Redelivery and Redirection

Redelivery Options

Progressive Delay

Example 1

Example 2

Delay and Redirect

Example 3

Example 4

Delay and Delete

Example 5

Specifying Redelivery Options in the JMS IQ Manager

Specifying Redelivery Options in a JMS Client

Enqueued Message Properties

Enqueue Time

Sequence Number

Performance Issues

Throttling Producers

Example of Producer Throttling and Unthrottling

JMS Object Type Definitions

Message Types

JMS Message Properties

JMS Message Header Properties

Additional JMS Message Properties

JMS OTD Methods

createBytesMessage()

Description

Parameters

Return Value

Exceptions

createBytesMessage(msg)

Description

Parameters

Return Value

Exceptions

createMapMessage()

Description

Parameters

Return Value

Exceptions

createMessage()

Description

Parameters

Return Value

Exceptions

createMessage(msg)

Description

Parameters

Return Value

Exceptions

createStreamMessage()

Description

Parameters

Return Value

Exceptions

createTextMessage()

Description

Parameters

Return Value

Exceptions

createTextMessage(msg)

Description

Parameters

Return Value

Exceptions

getDeliveryMode()

Description

Parameters

Return Value

Exceptions

getDestination()

Description

Parameters

Return Value

Exceptions

Also Accessible From

getMessageServerURL()

Description

Parameters

Return Value

Exceptions

getPriority()

Description

Parameters

Return Value

Exceptions

getTimeToLive()

Description

Parameters

Return Value

Exceptions

receive(timeout)

Description

Parameters

Return Value

Exceptions

receive(timeout, destination)

Description

Parameters

Return Value

Exceptions

receiveNoWait()

Description

Parameters

Return Value

Exceptions

receiveNoWait(destination)

Description

Parameters

Return Value

Exceptions

requestReply(message)

Description

Parameters

Return Value

Exceptions

requestReply(timeout, message)

Description

Parameters

Return Value

Exceptions

requestReplyTo(message, destName)

Description

Parameters

Return Value

Exceptions

requestReplyTo(timeout, message, destName)

Description

Parameters

Return Value

Exceptions

send(message)

Description

Parameters

Return Value

Exceptions

send(message, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

sendBytes(payload)

Description

Parameters

Return Value

Exceptions

sendBytes(payload, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

sendBytesTo(payload, destination)

Description

Parameters

Return Value

Exceptions

sendBytesTo(payload, destination, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

sendText(payload)

Description

Parameters

Return Value

Exceptions

sendText(payload, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

sendTextTo(payload, destination)

Description

Parameters

Return Value

Exceptions

sendTextTo(payload, destination, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

sendTo(message, destination)

Description

Parameters

Return Value

Exceptions

sendTo(message, destination, deliveryMode, priority, timeToLive)

Description

Parameters

Return Value

Exceptions

setDeliveryMode(arg0)

Description

Parameters

Return Value

Exceptions

setDestination(arg0)

Description

Parameters

Return Value

Exceptions

Also Accessible From

setMessageServerURL(arg0)

Description

Parameters

Return Value

Exceptions

setPriority(arg0)

Description

Parameters

Return Value

Exceptions

setTimeToLive(arg0)

Description

Parameters

Return Value

Exceptions

JMS Message Methods

countMapMessage()

Description

Parameters

Return Value

Exceptions

countStreamMessage()

Description

Parameters

Return Value

Exceptions

countUserProperty()

Description

Parameters

Return Value

Exceptions

getBytesMessage()

Description

Parameters

Return Value

Exceptions

getJMSMessageType()

Description

Parameters

Return Value

Exceptions

getMapMessage()

Description

Parameters

Return Value

Exceptions

getMapMessage(arg0)

Description

Parameters

Return Value

Exceptions

getMessageProperties()

Description

Parameters

Return Value

Exceptions

getStreamMessage()

Description

Parameters

Return Value

Exceptions

getStreamMessage(arg0)

Description

Parameters

Return Value

Exceptions

getTextMessage()

Description

Parameters

Return Value

Exceptions

getUserProperty()

Description

Parameters

Return Value

Exceptions

getUserProperty(arg0)

Description

Parameters

Return Value

Exceptions

retrieveBytesFromMessage()

Description

Parameters

Return Value

Exceptions

retrieveBytesFromMessage(arg0)

Description

Parameters

Return Value

Exceptions

retrieveMapMessage(arg0)

Description

Parameters

Return Value

Exceptions

retrieveMapMessageList()

Description

Parameters

Return Value

Exceptions

retrieveStringFromMessage()

Description

Parameters

Return Value

Exceptions

retrieveStringFromMessage(arg0)

Description

Parameters

Return Value

Exceptions

retrieveUserProperty(arg0)

Description

Parameters

Return Value

Exceptions

retrieveUserPropertyList()

Description

Parameters

Return Value

Exceptions

setBytesMessage(arg0)

Description

Parameters

Return Value

Exceptions

setJMSMessageType(arg0)

Description

Parameters

Return Value

Exceptions

setStreamMessage(arg0, arg1)

Description

Parameters

Return Value

Exceptions

setTextMessage(arg0)

Description

Parameters

Return Value

Exceptions

storeMapMessage(arg0, arg1)

Description

Parameters

Return Value

Exceptions

storeUserProperty(arg0, arg1)

Description

Parameters

Return Value

Exceptions

getTimeToWait()

Description

Parameters

Return Value

Exceptions

setTimeToWait(arg0)

Description

Parameters

Return Value

Exceptions

JMS Client Configuration

Categories

Consumers

Action

Allowed Values

Default Value

Concurrency

Default Value

Delay

Allowed Values

Default Value

Durable Subscriber Name

Durability

Allowed Values

Default Value

Message Selector

Move/Delete After N Times

Allowed Values

Default Value

Move to Queue/Topic

Allowed Values

Default Value

Move to Destination Name

Allowed Values

Default Value

Server Session Batch Size

Server Session Pool Size

Allowed Values

Default Value

Producers

Delivery Mode

Default Value

Idle Timeout

Default Value

Maximum Pool Size

Default Value

Maximum Wait Time

Default Value

Priority

Allowed Values

Default Value

Steady Pool Size

Default Value

Transaction Mode

Allowed Values

Default Value

JMS IQ Manager Runtime Configuration

Accessing the Configuration Properties

Configuration Properties Interface

Stable Storage Page

Segment Properties

Data Directory

Default Location

Block Size

Allowed Values

Default Value

Segment Size

Allowed Values

Default Value

Minimum Number of Segments

Allowed Values

Default Value

Maximum Number of Segments

Allowed Values

Default Value

Sync to Disk

Default Condition

Journaling and Expiration Properties

Enable Message Expiration

Maximum Lifetime

Default Value

Enable Journal

Default Condition

Journaling Maximum Lifetime

Default Value

Journal Directory

Allowed Values

Default Value

Messaging Behavior Page

Throttling Properties

Per-Destination Throttling Threshold

Allowed Values

Default Value

Server Throttling Threshold

Allowed Values

Default Value

Throttling Lag

Allowed Values

Default Value

Special FIFO Mode Properties

Fully Serialized Queues

Allowed Values

Protected Concurrent Queues

Allowed Values

FIFO Expiration Time

Default Value

Time Dependency Properties

Allowed Values

Access Control Page

Security Options

Default Condition

Diagnostics Page

Diagnostic Properties

Logging Level

Default Setting

Logging Level of Journaler

Default Condition

Maximum Log File Size

Allowed Values

Default value

Number of Backup Log Files

Allowed Values

Default value

Miscellaneous Page

Enable Alert Option

Default Condition

JMS Provider Management

Overview of MS Control Utility Features

MS Control Utility Details

Flags and Arguments

Syntax

Using the MS Control Utility

To Change Message Contents

To Create a Backup Archive File

To Access an Archive File

To Set the MS Control Utility Timeout Period

To Shut the Server Down

Command/Response Examples

Message Server Example

Message Destination (Queue) Examples

Message Destination (Topic) Examples

Message Examples

Troubleshooting

Timestamp Errors

Index

Stable Storage Page


Note - Modifying some properties, such as Block Size and Segment Size, requires changes to the database files. In such cases, you must manually delete the database files and restart the domain server before the changes take place. To prevent message loss, make sure that no unread messages remain before deleting the database files.


Segment Properties

Figure 17 Segment Properties Panel

image:Screen capture showing Segment properties options.

As described in JMS IQ Manager Database, the JMS IQ Manager uses the JMS IQ Manager database to store persistent messages. It also stores messages that are larger than can be kept in the JMS IQ Manager memory, which is determined by the cache size setting (by default 0.5 MBytes for Windows and 1 MByte for UNIX). You can specify several properties of this database file, as described in the following sections:

You can also specify whether or not the JMS IQ Manager controls the cache synchronization to disk by using the Sync to Disk option.

Data Directory

The Data Directory property specifies where the JMS IQ Manager database files are located for JMS IQ Managers. You can specify the location as an absolute path, or as a path relative to the ..\logicalhost\is\domains directory. Using an absolute path for the data directory enables you the store the JMS IQ Manager files on a different system.

If journaling is enabled, the data directory contains a journal directory, unless another location has been specified for the Journal Directory property. The journal directory holds the journaling database files. For information, refer to Journal Directory. Journaling is disabled by default.

Default Location

The default setting is:..\logicalhost\is\domains\domain_1\stcms\instance_1

Block Size

Data is read from and written to disk in units known as blocks. The Block Size property specifies the number of bytes per block.

Allowed Values

You can specify 0, 512, or 1024 bytes per block. If you specify 0, the server automatically determines the value by querying the operating system.

Default Value

The default is 0 bytes per block.


Note - Modifying the Block Size requires changes to the database files. You must manually delete the database files and restart the domain server before the changes take place. To prevent message loss, make sure that no unread messages remain before deleting the database files.


Segment Size

The JMS IQ Manager database consists of multiple memory-mapped database files known as segments. The Segment Size property specifies the total number of pages in each segment file. A page is 512 bytes on Windows and 1024 bytes on UNIX. The default segment size is 16,384 pages, which is 8 MBytes for Windows and 16 MBytes for UNIX. By default, these segments are named stcms*.dbs and reside in the message server folder on the Logical Host.

You should set the segment size to a value larger than the sum of the following items:


Note - The transaction size is the sum of the sizes of all messages in one transaction. If transactions span no more than one message, the maximum transaction size is equal to the size of the largest message.


For example, consider a UNIX system, where you expect no more than 100 subscribers and that messages will not exceed 100 KBytes, and that only one message will be sent/received per transaction. Since the page size on UNIX is 1 KByte, you would set the segment size to at least [100 + (100KBytes/1KByte) + 10] = 210 pages.

With this setting, only one 100,000 byte message may exist in each segment. The ideal segment size depends on the circumstances. If the slowest subscriber lags behind the fastest publisher by a certain number of messages, you can set the segment size so that this number of messages will fit a single segment.

The JMS IQ Manager cleans up the database by recycling segments for which all messages have either expired or have been retrieved by their subscribers.

A lower segment size setting results in more efficient use of the disk because smaller segments turn over more rapidly and thus provide more effective use of server memory. However, a lower segment size means that the server might need to allocate more new segments, which requires more time than freeing a cleaned-up segment. In addition, if a transaction is larger than the specified segment size, the server rolls back the transaction. You must then increase the Segment Size property to an amount larger than the message.

A high segment size setting can be advantageous in that cleanup runs less often, although each cleanup takes somewhat longer. However, cleaning up two small segments still requires more time than cleaning up one large segment. Therefore, a large segment size can increase performance on systems that are constrained by disk I/O speed rather than memory or storage space.

Allowed Values

An integer greater than 1. Set this property to at least twice the total number of anticipated durable subscribers.

Default Value

The default segment size is 16,384 pages, which is 8 MBytes for Windows and 16 MBytes for UNIX.


Note - Modifying the Segment Size requires changes to the database files. You must manually delete the existing database files and restart the domain server before the changes actually occur. To prevent message loss, make sure that no unread messages remain before deleting the database files.


Minimum Number of Segments

The Minimum Number of Segments property specifies the minimum number of database files (segments) that the JMS IQ Manager creates initially for stable message storage. When the minimum is exceeded, the server allocates additional segments on an as-needed basis, up to the number of files specified for the Maximum Number of Segments property as described in Maximum Number of Segments.

In addition to limiting the maximum number of segments, you can also specify the size limit for segments. For more information about the Segment Size property, refer to Segment Size.

Allowed Values

An integer from 1 through 99,999 indicating the number of segments.

Default Value

The default is 4 segments.

Maximum Number of Segments

The Maximum Number of Segments property specifies the upper limit for the number of database files (segments) that the JMS IQ Manager creates for its stable message storage. You use this property to limit the amount of disk space that the JMS IQ Manager uses. If the JMS IQ Manager attempts to write data that exceeds this limit, it exits gracefully and logs an error message in the JMS IQ Manager log.

Allowed Values

An integer from 0 through 99,999 indicating the number of segments.

Default Value

The default is 0. This value causes the JMS IQ Manager to create new files as needed, limited only by available disk space.

Sync to Disk

The Sync to Disk property specifies whether the JMS IQ Manager controls cache synchronization to disk. When you disable cache control, the operating system controls the synchronization schedule. Disabling cache control increases performance, but also increases risk of message loss in the event of system failure.

Default Condition

This property is disabled by default.

Journaling and Expiration Properties

Figure 18 Journaling and Expiration Properties Panel

image:Screen capture showing Journaling and Expiration properties options.

Journaling messages enables you to republish messages at a later date. You can specify several options and properties for journaling, as described in the following sections:

To republish journaled messages, you use the STC MS Control utility as described in Example 19 or Example 20. You can also use the STC MS Control utility to browse journaled messages with the -journaler flag. For information, refer to Example 9.

Enable Message Expiration

Use the Enable Message Expiration option to enable or disable message expiration for JMS IQ Managers. When you enable message expiration, messages are removed from the queue after the time specified for the Maximum Lifetime property has expired.

Maximum Lifetime

The Maximum Lifetime property specifies the maximum amount of time before a live message expires. After it expires, the message is removed from the queue regardless of whether it has been consumed. If you specify 0, the message never expires.

Default Value

The default is 2592000 seconds (30 days).

Enable Journal

Use the Enable Journal option to enable or disable journaling for JMS IQ Managers. When you enable journaling, every inbound message is automatically copied to the journal database. The message is then held in the journal database for the duration of the time to live value specified for journaled messages.

By default, the expiration time for a journaled message is 7 days. To change the time to live for journaled messages, refer to Journaling Maximum Lifetime. The time to live property for journaled messages is completely independent of when the live counterpart of the message is consumed by its publisher.

When a journaled message expires, it is not deleted from the journal database, but remains there until you back up the topics or queues. When you back up, all messages in the journal database are included in the archive, and the journal expired messages are removed from the journal database. You should back up daily when journaling is enabled; otherwise, the journal database retains journal expired messages and can grow exceedingly large. Because the journal database and the JMS IQ Manager database are located on the same system, you must guard against running out of disk space.

To back up the journal database, you use the MS Control Utility. For more information, refer to To Create a Backup Archive File.

When messages are in the journal database, you can view them but not edit them. You can use either Enterprise Manager or the STC MS Control utility to view and republish journaled messages. For more information about the MS Control utility, see JMS Provider Management.

Default Condition

Journaling is disabled by default.

Journaling Maximum Lifetime

The Journaling Maximum Lifetime property specifies the maximum amount of time that a journaled message persists before it expires. The JMS IQ Manager journals messages only when journaling is enabled as described in Enable Journal. Journaling is disabled by default.

When a journaled message expires, it is not deleted from the journal database, but remains there until you back up the topics or queues. When you back up, all messages in the journal database are included in the archive (.zip) file, and the expired messages are removed from the journal database.

Default Value

The default is 604800 seconds (7 days).

Journal Directory

The Journal directory holds the journal database files and the journaling log file. You can enter an absolute path or a path relative to the ..\logicalhost\is\domains directory. Using an absolute path for the data directory enables you to store the journal database files on a different system, for example, for backup purposes.

The JMS IQ Manager creates a journal directory only when journaling is enabled. Journaling is disabled by default. For more information, refer to Enable Journal.

Allowed Values

An absolute path or a path relative to the ..\logicalhost\is\domains directory.

Default Value

By default, the journal database files are stored in the following folder:..\logicalhost\is\domains\domain_1\stcms\instance_1\journal