Sun GlassFish Message Queue 4.4 Administration Guide

Persistence Properties

Message Queue supports both file-based and JDBC-based persistence modules. The broker property imq.persist.store (Table 17–4) specifies which module to use. The following sections describe the broker configuration properties for the two modules.

Table 17–4 Global Broker Persistence Property

Property 

Type 

Default Value 

Description 

imq.persist.store

String 

file

Module used for persistent data storage:  

    file: File-based persistence


    jdbc: JDBC-based persistence


Must be set to jdbc for enhanced broker clusters (imq.cluster.ha = true).

File-Based Persistence Properties

Table 17–5 lists the broker properties related to file-based persistence.

Table 17–5 Broker Properties for File-Based Persistence

Property 

Type 

Default Value 

Description 

imq.persist.file.message.max_record_size

String 

1m

Maximum-size message to add to message storage file 

Any message exceeding this size will be stored in a separate file of its own.  

     

The value may be expressed in bytes, kilobytes, or megabytes, using the following suffixes:  

    b: Bytes


    k: Kilobytes (1024 bytes)


    m: Megabytes (1024 × 1024 = 1,048,576 bytes)


An unsuffixed value is expressed in bytes.  

     

Examples:

    1600: 1600 bytes


    1600b: 1600 bytes


    16k: 16 kilobytes (= 16,384 bytes)


    16m: 16 megabytes (= 16,777,216 bytes)


imq.persist.file.destination.message.filepool.limit

Integer 

100

Maximum number of free files available for reuse in destination file pool 

Free files in excess of this limit will be deleted. The broker will create and delete additional files in excess of the limit as needed.  

The higher the limit, the faster the broker can process persistent data.  

imq.persist.file.message.filepool.cleanratio

Integer 

0

Percentage of files in free file pools to be maintained in a clean (empty) state 

The higher this value, the less disk space is required for the file pool, but the more overhead is needed to clean files during operation.  

imq.persist.file.message.cleanup

Boolean 

false

Clean up files in free file pools on shutdown?  

Setting this property to true saves disk space for the file store, but slows broker shutdown.

imq.persist.file.sync.enabled

Boolean 

false

Synchronize in-memory state with physical storage device? 

Setting this property to true eliminates data loss due to system crashes, but at a cost in performance.


Note –

If running Sun Cluster and the Sun Cluster Data Service for Message Queue, set this property to true for brokers on all cluster nodes.


imq.persist.file.transaction.memorymappedfile.enabled

Boolean 

true

Use memory-mapped file to store transaction data?  

Setting this property to true improves performance at the cost of increased memory usage. Set to false for file systems that do not support memory-mapped files.

File-Based Persistence Properties for Transaction Logging

Table 17–6 lists the file-based persistence properties for the transaction logging mechanism introduced in Message Queue 4.4 Update 1.

Table 17–6 Broker Properties for File-Based Persistence Using the Transaction Logging Mechanism

Property 

Type 

Default Value 

Description 

imq.persist.file.newTxnLog.enabled

Boolean 

false

Enables the transaction logging mechanism introduced in Message Queue 4.4 Update 1. For information about this mechanism, see Optimizing File-Based Transaction Persistence.

imq.persist.file.txnLog.groupCommit

Boolean 

false

This property is applicable only if imq.persist.file.newTxnLog.enabled is true.

Can improve performance if imq.persist.file.sync.enabled is true and the number of concurrent transactions being processed is high:

  • If true, write operations to the transaction log are not handled by individual connection threads; instead, writes from connection threads are added to a transaction queue. The connection threads then wait until they are notified that the transactions have been logged. A separate thread periodically drains the transaction queue and writes it to the transaction log. When possible, this thread groups together multiple active transactions and writes them to the transaction log in a single operation. After the write completes, waiting client threads are notified.

  • If false, write operations to the transaction log are handled by individual connection threads. Only one thread at a time is able to write to the log.

imq.persist.file.txnLog.logNonTransactedMsgSend

Boolean 

false

This property is applicable only if imq.persist.file.newTxnLog.enabled is true.

Overrides the behavior for persisting non-transacted messages (as defined by the imq.persist.file.sync.enabled property):

  • If true, non-transacted messages are written to the transaction log before they are written to the persistent store.

  • If false, non-transacted messages are written directly to the persistent store.

imq.persist.file.txnLog.logNonTransactedMsgAck

Boolean 

false

This property is applicable only if imq.persist.file.newTxnLog.enabled is true.

Overrides the behavior for persisting non-transacted message acknowledgements (as defined by the imq.persist.file.sync.enabled property):

  • If true, acknowledgements of non-transacted messages are written to the transaction log before they are written to the persistent store.

  • If false, acknowledgements of non-transacted messages are written directly to the persistent store.

JDBC-Based Persistence Properties

Table 17–7 lists the broker properties related to JDBC-based persistence. The first of these properties, imq.persist.jdbc.dbVendor, identifies the database vendor being used for the broker’s persistent data store; all of the remaining properties are qualified by this vendor name.

Table 17–7 Broker Properties for JDBC-Based Persistence

Property 

Type 

Default Value 

Description 

imq.persist.jdbc.dbVendor

String 

None 

Name of database vendor for persistent data store:  

    hadb: HADB (Sun Microsystems, Inc.)


    derby: Java DB (Sun Microsystems, Inc.)


    oracle: Oracle (Oracle Corporation)


    mysql: MySQL (Sun Microsystems, Inc.)


    postgresql: postgreSQL


imq.persist.jdbc.connection.limit

Integer 

5

The maximum number of connections that can be opened to the database. 

imq.persist.jdbc.vendorName.driver

String 

per vendor 

Java class name of JDBC driver, if needed, for connecting to database from vendor vendorName

imq.persist.jdbc.vendorName.opendburl

String 

None 

URL for connecting to existing database from vendor vendorName

Applicable when driver is used to connect to database. 

imq.persist.jdbc.vendorName.createdburl [Optional]

String 

None 

URL for creating new database from vendor vendorName

Applies for embedded database, such as Java DB. 

imq.persist.jdbc.vendorName.closedburl

String 

None 

URL for closing connection to database from vendor vendorName

Applies for some embedded databases, such as Java DB. 

imq.persist.jdbc.vendorName.user

String 

None 

User name, if required, for connecting to database from vendor vendorName

For security reasons, the value can instead be specified using command line options imqbrokerd -dbuser and imqdbmgr -u.

imq.persist.jdbc.vendorName.needpassword

Boolean 

false

Does database from vendor vendorName require a password for broker access?

If true, the imqbrokerd and imqdbmgr commands will prompt for a password, unless you use the -passfile option to specify a password file containing it.

imq.persist.jdbc.vendorName.password, [Should be used only in password files]

String 

None 

Password, if required, for connecting to database from vendor vendorName

imq.persist.jdbc.vendorName.property.propName

String 

None 

Vendor-specific property propName for database from vendor vendorName

imq.persist.jdbc.vendorName.tableoption

String 

None 

Vendor-specific options passed to the database when creating the table schema.