Skip navigation.

Programming WebLogic JMS

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

Introduction to WebLogic JMS

The following sections provide an overview of the Java Message Service (JMS) for BEA WebLogic Server:


Overview of WebLogic JMS

WebLogic JMS is an enterprise-class messaging system that is tightly integrated into the WebLogic Server platform. It fully supports the JMS Specification and also provides numerous WebLogic JMS Extensions that go above and beyond the standard JMS APIs.

What Is the Java Message Service?

An enterprise messaging system, also referred to as message-oriented middleware (MOM), enables applications to communicate with one another through the exchange of messages. A message is a request, report, and/or event that contains information needed to coordinate communication between different applications. A message provides a level of abstraction, allowing you to separate the details about the destination system from the application code.

The Java Message Service (JMS) is a standard API for accessing enterprise messaging systems. Specifically, JMS:

The following figure illustrates WebLogic JMS messaging.

Figure 1-1 WebLogic JMS Messaging

WebLogic JMS Messaging


As illustrated in the figure, WebLogic JMS accepts messages from producer applications and delivers them to consumer applications.

Implementation of Java Specifications

WebLogic Server is compliant with the following Java specifications.

J2EE Specification

WebLogic Server is compliant with the Sun Microsystems J2EE 1.3 specification.

JMS Specification

WebLogic Server is fully compliant with version 1.0.2b of the JMS Specification, and can be used in production.

WebLogic JMS Features

WebLogic JMS provides numerous WebLogic JMS Extension APIs that go above and beyond the standard JMS APIs specified by the JMS Specification. Moreover, it is tightly integrated into the WebLogic Server platform, allowing you to build highly-secure J2EE applications that can be easily monitored and administered through the WebLogic Server console. In addition to fully supporting XA transactions, WebLogic JMS also features high availability through its clustering and service migration features, while also providing seamless interoperability with other versions of WebLogic Server and third-party messaging providers.

The following sections provide an overview of the unique features and powerful capabilities of WebLogic JMS.

Enterprise-Grade Reliability

Enterprise-Level Features

Tight Integration With WebLogic Server

Interoperability with Other Messaging Services


WebLogic JMS Architecture

The following figure illustrates the WebLogic JMS architecture.

Figure 1-2 WebLogic JMS Architecture

WebLogic JMS Architecture


Major Components

The major components of the WebLogic JMS Server architecture, as illustrated in Figure 1-2, include:

Clustering Features

The WebLogic JMS architecture implements clustering of multiple JMS servers by supporting cluster-wide, transparent access to JMS destinations from any server in the cluster. Although WebLogic Server supports distributing JMS destinations and connection factories throughout a cluster, JMS topics and queues are still managed by WebLogic Server instances in the cluster.

For more information about configuring clustering for WebLogic JMS, see Configuring WebLogic JMS Clustering. For detailed information about WebLogic Server clustering, see Using WebLogic Server Clusters.

The advantages of clustering include the following:

Note: Automatic failover is not supported by WebLogic JMS for this release. For information about performing a manual failover, refer to Recovering from a WebLogic Server Failure.


WebLogic JMS Public API Extensions

In addition to the API specified by the Sun Microsystems JMS Specification, WebLogic JMS provides a public API, weblogic.jms.extensions, which includes classes and methods for the extensions described in the following table.

Table 1-1 WebLogic JMS Public API Extensions



For more information, see. . .


Create XML messages

Step 6a: Create the Message Object (Message Producers)


Define a session exception listener

Defining a Session Exception Listener


Set or display the maximum number of pre-fetched asynchronous messages allowed on a multicast session

Dynamically Configuring Multicasting Configuration Attributes


Set or display the multicast session overrun policy that is applied when the message maximum is reached

Dynamically Configuring Multicasting Configuration Attributes


Dynamically create permanent queues or topics

Creating Destinations Dynamically


Dynamically delete permanent queues or topics

Deleting Destinations Dynamically


Dynamically create and delete a distributed destination (DD). These methods will also create or delete the DD queue or topic members on each specified JMS server instance, as well as a JMS template that will be used for all the member destinations.

"JMS Helper" Javadoc.


Set a redelivery delay for messages

Setting a Redelivery Delay for Messages


Set a message delivery time for producers

Setting a Delivery Time on Producers


Set a delivery time for messages

Setting a Delivery Time on Messages

Class Schedule

Set a scheduled delivery time for messages

Setting a Scheduled Time-to-Deliver Override


Create server session pools, an optional application server facility described in the JMS specification

Defining Server Session Pools

This API also supports NO_ACKNOWLEDGE and MULTICAST_NO_ACKNOWLEDGE acknowledge modes, and extended exceptions, including throwing an exception:


JMS Enhancements in WebLogic Server 8.1

The following JMS enhancements are new to this release of WebLogic Server.

JMS Thin Client

At approximately 400KB, the JMS thin application client (wljmsclient.jar) file provides full WebLogic JMS functionality, yet greatly reduces the client-side WebLogic footprint by using a smaller library that contains only the set of supporting files required by client-side programs. The JMS thin client also requires using the standard WebLogic thin application client JAR (wlclient.jar), around 300KB, which contains the base client support for clustering, security, and transactions, and failover. See WebLogic JMS Thin Client.

Simplified Access to Remote or Third-Party JMS Providers

Using the Foreign JMS Server node on the Administration Console, you can quickly map a foreign (non-WebLogic Server) JMS provider so that its connection factories and destinations appear in the WebLogic JNDI tree as local JMS objects. A Foreign JMS Server configuration can also be used to reference remote instances of WebLogic Server in another cluster or domain in the local WebLogic JNDI tree. See "Simple Access to Remote or Foreign JMS Providers" in the Administration Console Online Help.

Easier Access to JMS Through EJBs and Servlets

WebLogic Server now uses JMS wrappers that make it easier to use WebLogic JMS inside a J2EE component, such as an EJB or a servlet, while also providing a number of enhanced usability and performance features: automatic pooling of JMS connection and session objects (and some pooling of message producer objects as well); automatic transaction enlistment for WebLogic JMS implementations and for third-party JMS providers that support two-phase commit transactions (XA protocol); testing of the JMS connection, as well as re-establishment after a failure; and security credentials that are managed by the container. See Using JMS with EJBs and Servlets.

Better Expired Message Handling

Active message expiration ensures that expired messages are cleaned up immediately. Moreover, expired message auditing gives you the option of tracking expired messages, either by logging when a message expires or by redirecting expired messages to a special destination. For more information, see "Handling Expired Messages" in the Administration Console Online Help.

Improved Message Flow Control by Blocking Producers

The "Blocking Send" features help you avoid receiving message quota errors by temporarily blocking message producers from sending messages to a destination (queue or topic) when the destination has exceeded its specified maximum message quota. See "Avoiding Quota Exceptions by Blocking Message Producers" in the Administration Console Online Help.

Ordered Redelivery of Messages

As per the JMS Specification, all messages initially delivered to a consumer from a given producer are guaranteed to arrive at the consumer in the order in which they were produced. WebLogic JMS goes above and beyond this requirement by guaranteeing the correct ordering of redelivered messages as well. For more information, see Ordered Redelivery of Messages.

Dynamically Deleting Queue or Topic Destinations

New JMS Helper extension methods enable you to dynamically delete JMS destinations. The JMS server removes the deleted destination in real time; therefore, it is unnecessary to redeploy the JMS server for the deletion to take effect. See Deleting Destinations Dynamically.

Using the Configuration Wizard to Configure JMS

The Configuration Wizard is a Java application that creates WebLogic Server administration domain and server configurations. You can use the Configuration Wizard to configure such resources as JMS, database connectivity (JDBC), and security groups, security roles, and user accounts. You can also use the Configuration Wizard to modify existing domains. See "Configuring WebLogic Platform."


JMS Deprecations in WebLogic Server 8.1

The following JMS deprecations occurred in this release of WebLogic Server.

ServerSessionPoolFactory Class in the weblogic.jms Package

The ServerSessionPoolFactory class in the weblogic.jms package is deprecated in WebLogic Server 8.1 and is replaced by the ServerSessionPoolFactory class in the weblogic.jms.extensions package. Although BEA recommends using the new version in the weblogic.jms.extensions package when binding a ServerSessionPoolFactory into JNDI. However, for release 8.1 you can still perform the JNDI lookup with either version. For more information about server session pool factories, see Defining Server Session Pools or the weblogic.jms.extensions.ServerSessionPoolFactory Javadoc.

Boot Flags for Disabling Synchronous Writes on JMS File Stores

The following command-line boot flags for disabling synchronous writes on JMS file stores are deprecated in WebLogic Server 8.1:


Instead, use JMS -> Stores node on the Administration Console or JMX to configure the JMS file store Synchronous Write Policy attribute. For more information about configuring the Synchronous Write Policy, see "Improving JMS File Store Performance" in the Administration Console Online Help.

JMS Connection Factory "User Transactions Enabled" and "Server Side XA Enabled" Attributes

The "User Transactions Enabled" and "Server Side XA Enabled" attributes are deprecated in WebLogic Server 8.1 for user-defined JMS connection factories. Therefore, to enable an XA connection factory for JTA user-transactions, you need only set the "XA Connection Factory Enabled" attribute. An XA factory is not required for transacted sessions. For more information about configuring a connection factory, see "Configuring a JMS Connection Factory" in the Administration Console Online Help.


Skip navigation bar  Back to Top Previous Next