WebLogic Server

WebLogic Server is an industry-standard application server from BEA Systems. Along with supporting most of the enterprise Java API like EJBs and JSPs, WebLogic is fully compliant with the JMS 1.0.2 specification. The latest version of WebLogic (v 6.0) implements EJB 2.0 specification (as an optional add-on) and supports message-driven EJBs that are activated by JMS messages. An evaluation version of WebLogic 6.0 is available from http://www.bea.com.

WebLogic JMS Features

WebLogic supports both Pub/Sub and PTP messaging models. WebLogic JMS can work with other WebLogic features like EJBs, JSPs, servlets, JDBC connection pools, JTA, etc. The main WebLogic features related to JMS are listed below:

  • WebLogic 6.0 implements JMS 1.0.2.

  • JMS configuration properties can be set using the administration console.

  • JMS applications can interoperate with other resource managers (primarily databases) using the JTA. JMS applications can participate in transactions with other Java APIs, like EJBs, that use JTA.

  • Supports message multi-casting.

  • Supports databases and files for persistent message storage.

  • Can work with other enterprise APIs such as Enterprise Java Beans (EJB), JDBC connection pools, servlets, and RMI.

  • WebLogic also ships with JDBC drivers for all the popular RDBMS vendors. It also supports databases like Cloudscape in which Java objects can be stored directly.

  • WebLogic 6.0 implements EJB 2.0 beta and supports message-driven EJBs.

  • WebLogic provides server clustering and the following clustering features are available for JMS applications:

  • Load balancing within a cluster

  • Transparent access to destinations from any server in the cluster

  • WebLogic also provides custom JMS extensions listed below:

  • Create XML messages

  • A session exception listener similar to the standard JMS connection exception listener

  • A configurable threshold of pre-fetched asynchronous messages allowed on the session

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

  • Dynamic creation of permanent queues or topics

  • Also supports NO_ACKNOWLEDGE and MULTICAST_NO_ACKNOWLEDGE modes, and extended exceptions

  • Custom destination templates that can be shared by multiple destinations

  • Use of destination keys to set message sort order

Running the startWebLogic.cmd file on Windows platforms or the startWebLogic.sh file on UNIX platforms can start WebLogic server. The server reads all the configuration information from the properties file on startup. It initializes the queues, topics, and connection factories defined in the properties file during startup. WebLogic 6.0 server can be started on Windows platforms using the Start Default Server shortcut available on the Start menu.

WebLogic Console

WebLogic Server 6.0 provides a powerful browser-based administration console. The console can be accessed using the URL http://<host:port>/console where the host and port are the host and port on which the server is listening. The default port is 7001. The screenshot below shows the administration console for WebLogic 6.0 with one of the JMS-specific screens open:

click to expand

Running the Portable JMS Client

We will be storing the Administered objects in the internal JNDI namespace provided by the WebLogic server and later looking them up using JNDI. We will be using WebLogic 6.0 for this example.

Configuring the Administered Objects

Start the WebLogic server using the short cut available under the Start menu on Windows platforms or the shell-scripts available for UNIX platforms. Once the server is up and running start your browser window and access the URL http://localhost:7001/console assuming the server is running on the local machine and listening on the default port. You will have to enter the password for the system user that you configured at installation.

Expand the JMS node under the Services node in the left-hand tree and click on the Servers node under the JMS node. Now click on the Create a new JMSServer link on the right-hand panel:

click to expand

Enter the text MyJMSServer for the server name, leave everything else as default, and click on the Create button:

click to expand

Now click on the Targets tab and add the JMS server created in the last step to the required WebLogic server. Here I am using the default server myserver. Select the server from the Available list and add it to the Chosen list. Now click on the Apply button:

click to expand

Now expand the node MyJMSServer under the Servers node and click on the Destinations node. Now click on the Create a new JMSTopic link on the right-hand panel. Add the topic name and JNDI name as myTopic, leave everything else as default, and click on the Create button:

click to expand

Now click on the Connection Factories node and then click on the Create a new JMSConnectionFactory link on the right-hand panel. Enter the connection factory name and the JNDI name as TCFactory, leave everything else as default, and click on the Create button:

click to expand

Now click on the Targets tab and make the newly created connection factory available to the required server. Select the server from the Available list and add it to the Chosen list. Now click on the Apply button.

Running the Client

For running the client first start the WebLogic server as explained earlier. Now invoke the Java interpreter on the class PortableJMSClient with all the required classes in the classpath, and passing the JNDI provider URL and the JNDI initial context factory as command-line arguments.

The required JAR files are:

  • weblogic.jar — This JAR file contains all the required classes for JNDI and JMS. This can be found in the lib directory under the WebLogic installation.

The following command-line arguments should be passed to the program for running the client:

  • weblogic.jndi.T3InitialContextFactory — This is the initial context factory for the JNDI lookup

  • t3://localhost:7001: This is the JNDI service provider URL

The figure below shows the JMS client running against WebLogic:

click to expand



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net