![]() |
![]() |
|
Managing JMS
This section explains how to manage WebLogic JMS, describing the following topics:
Using the Administration Console, you define configuration attributes to:
WebLogic JMS provides default values for some configuration attributes; you must provide values for all others. If you specify an invalid value for any configuration attribute, or if you fail to specify a value for an attribute for which a default does not exist, the WebLogic Server will not boot JMS when you restart it. A sample JMS configuration is provided with the product.
When migrating from a previous release, the configuration information will be converted automatically, as described in "Migrating Existing Applications" in Programming WebLogic JMS.
To configure WebLogic JMS attributes, perform the following steps:
Once WebLogic JMS is configured, applications can begin sending and receiving messages using the JMS API. For more information about developing WebLogic JMS applications, see "Developing a WebLogic JMS Application" in Programming WebLogic JMS.
Note: To assist with your WebLogic JMS configuration planning, Programming WebLogic JMS provides configuration checklists that enable you to view the attribute requirements and/or options that support various JMS features.
Configuring Connection Factories
Connection factories are objects that enable JMS clients to create JMS connections. A connection factory supports concurrent use, enabling multiple threads to access the object simultaneously. You define and configure one or more connection factories to create connections with predefined attributes. WebLogic Server adds them to the JNDI space during startup, and the application then retrieves a connection factory using WebLogic JNDI.
You can establish cluster-wide, transparent access to destinations from any server in the cluster by configuring multiple connection factories and using targets to assign them to WebLogic Servers. Each connection factory can be deployed on multiple WebLogic Servers. For more information on JMS clustering, refer to "WebLogic JMS Fundamentals"in Programming WebLogic JMS.
To configure connection factories, use the Connection Factories node in the Administration Console to define the following:
WebLogic JMS defines one connection factory, by default: weblogic.jms.ConnectionFactory. All configuration attributes are set to their default values for this default connection factory, as described in "JMS Connection Factories" in the Administration Console Online Help.
If the default connection factory definition is appropriate for your application, you do not need to configure any additional connection factories for your application.
Note: Using the default connection factory, you have no control over the JMS server on which the connection factory may be deployed. If you would like to target a particular JMS server, create a new connection factory and specify the appropriate JMS server target(s).
For instructions on creating and configuring a connection factory, see "JMS Connection Factories" in the Administration Console Online Help.
Some connection factory attributes are dynamically configurable. When dynamic attributes are modified at run time, the new values become effective for new connections only, and do not affect the behavior of existing connections.
Templates provide an efficient way to define multiple destinations with similar attribute settings. Templates offer the following benefits:
To define the destination template configuration attributes, use the Templates node in the Administration Console. The configurable attributes for a destination template are the same as those configured for a destination. These configuration attributes are inherited by the destinations that use them, with the following exceptions:
Any attributes that are not explicitly defined for a destination are assigned default values. If no default value exists, then you must be sure to specify a value within the destination template or as a destination attribute override. If you do not do so, the configuration information remains incomplete, the WebLogic JMS configuration fails, and the WebLogic JMS does not boot.
For instructions on creating and configuring a template, see "JMS Templates" in the Administration Console Online Help.
Destination keys are used to define the sort order for a specific destination.
To create a destination key, use the Destination Keys node in the Administration Console and define the following configuration attributes:
For instructions on creating and configuring a destination key, see "JMS Destination Keys" in the Administration Console Online Help.
The backing store consists of a file or database that is used for persistent messaging.
Through the use of JDBC, JMS enables you to store persistent messages in a database, which is accessed through a designated JDBC connection pool. The JMS database can be any database that is accessible through a JDBC driver. WebLogic supports and provides JDBC drivers for the following databases:
Optionally, you can restrict the access control list (ACL) for the JDBC connection pool. If you restrict this ACL, you must include the WebLogic system user and any user who sends JMS messages in the list. For more information, see "Managing Security" in the Administration Guide.
Note: The JMS examples are set up to work with the Cloudscape Java database. An evaluation version of Cloudscape is included with WebLogic Server and a demoPool database is provided.
To create a file or database store, use the Stores node in the Administration Console and define the following configuration attributes:
Warning: You cannot configure a XA connection pool with a JDBC database store.
Note: JMS backing stores can increase the amount of memory required during initialization of a WebLogic Server as the number of stored messages increases. If initialization fails due to insufficient memory when you are rebooting a WebLogic Server, increase the heap size of the Java Virtual Machine (JVM) proportionally to the number of messages that are currently stored in the JMS backing store. Try rebooting again.
The JMS database contains two system tables that are generated automatically and are used internally by JMS, as follows:
The prefix name uniquely identifies JMS tables in the backing store. Specifying unique prefixes allows multiple stores to exist in the same database. The prefix is configured via the Administration Console when configuring the JDBC store. A prefix is prepended to table names when the DBMS requires fully qualified names, or when you must differentiate between JMS tables for two WebLogic servers, enabling multiple tables to be stored on a single DBMS.
The prefix should be specified using the following format, which will result in a valid table name when prepended to the JMS table name:
[[catalog.]schema.]prefix
Warning: No two JMS stores should be allowed to use the same database tables, as this will result in data corruption.
For instructions on creating and configuring a store, see "JMS File Stores" and "JMS JDBC Stores" for information about file and JDBC database stores, respectively, in the Administration Console Online Help.
Recommended JDBC Connection Pool Settings for JMS Stores
For implementations using a JDBC store, if the DBMS should shut down and then come back online, WebLogic JMS will not be able to access the store until WebLogic Server is shutdown and restarted. To avoid this situation, you should configure the following attributes on the JDBC Connection Pool associated with the JMS store:
TestConnectionsOnReserve="true"
TestTableName="[[[catalog.]schema.]prefix]JMSState"
Otherwise, if the JDBC resource goes down and comes back up, JMS cannot re-use it until the WebLogic Server is shutdown and restarted.
A JMS server manages connections and message requests on behalf of clients.
To create a JMS server, use the Servers node in the Administration Console and define the following:
Note: The deployment of a JMS server differs from that of a connection factory or template. A JMS server is deployed on a single server. A connection factory or template can be instantiated on multiple servers simultaneously.
For instructions on creating and configuring a JMS server, see "JMS Servers" in the Administration Console Online Help.
A destination identifies a queue or topic. Once you have defined a JMS server, you can configure its destinations. You can configure one or more destinations for each JMS server.
You can configure destinations explicitly or by configuring a destination template that can be used to define multiple destinations with similar attribute settings, as described in Configuring Templates.
To configure destinations explicitly, use the Destinations node in the Administration Console, and define the following configuration attributes:
For instructions on creating and configuring a destination, see "JMS Destinations" in the Administration Console Online Help.
Some destination attributes are dynamically configurable. When attributes are modified at run time, only incoming messages are affected; stored messages are not affected.
Server session pools enable an application to process messages concurrently. Once you have defined a JMS server, you have the option of configuring its server session pools. You can configure one or more session pools for each JMS server.
To configure server session pools, use the Session Pools node in the Administration Console and define the following configuration attributes:
For instructions on creating and configuring a session pool, see "JMS Session Pools" in the Administration Console Online Help.
Some session pool attributes are dynamically configurable, but the new values do not take effect until the session pools are restarted.
Configuring Connection Consumers
Connection consumers retrieve server sessions and process messages. Once you have defined a session pool, you have the option of configuring its connection consumers. You can configure one or more connection consumers for each session pool.
To configure connection consumers, use the Session Pools node in the Administration Console to define the following configuration attributes:
To create and configure a connection consumer, and for detailed information about each of the connection consumer configuration attributes, see "JMS Connection Consumers" in the Administration Console Online Help.
Monitoring JMS
Statistics are provided for the following JMS objects: JMS servers, connections, sessions, destinations, message producers, message consumers, and server session pools. You can monitor JMS statistics using the Administration Console.
JMS statistics continue to increment as long as the server is running. Statistics can be reset only when the server is rebooted.
To view JMS monitoring information, perform the following steps:
The JMS Servers information is displayed in the right pane.
The specified JMS server information is displayed in the right pane.
For detailed information about the information being monitored, see the Administration Console Online Help.
Recovering From a WebLogic Server Failure
The following sections describe how to restart or replace a WebLogic Server in the event of a system failure, and provide programming considerations for gracefully terminating an application following such an event.
Restarting or Replacing the WebLogic Server
In the event that a WebLogic Server fails, there are three methods that you can use to perform a system recovery:
To restart the failed server or start up a new server using the same IP address as the failed server, boot the server and start the server processes, as described in Starting and Stopping WebLogic Servers in the Administration Guide.
To start up a new server using a different IP address than the failed server:
Note: JMS backing stores can increase the amount of memory required during initialization of a WebLogic Server as the number of stored messages increases. When rebooting a WebLogic Server, if initialization fails due to insufficient memory, increase the heap size of the Java Virtual Machine (JVM) proportionally to the number of messages that are currently stored in the JMS backing store and try the reboot again.
You may want to program your application to terminate gracefully in the event of a WebLogic Server failure. For example:
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|