12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OpenJMS<br />

Even though OpenJMS can be used in a standalone mode where it is the only service<br />

in the partition, there are some advantages to using OpenJMS as an in-process<br />

service:<br />

■<br />

■<br />

It helps avoid the two-phase commit (2PC), and hence the performance cost and<br />

deployment complexity associated with it. This involves JDBC connection sharing<br />

among different components in the partition that access the database. It can be<br />

achieved by making OpenJMS persist messages in the same database as the one<br />

in which application data is stored. This configuration where 2PC can be avoided is<br />

possible only when OpenJMS is accessed through its embedded or RMI connector<br />

inside the BES partition. See “Configuring Datasource to Achieve 2PC Optimization”<br />

on page 232 for details.<br />

Since all the components are centralized in a single virtual machine, you can avoid<br />

the cost of TCP/IP. The JMS client library calls an in-process JMS service using<br />

regular Java call and vice versa.<br />

■<br />

Since VBJ provides local call optimizations, the application won't need to have two<br />

types of connectors. It can use only the RMI connector irrespective of client location<br />

with respect to the JMS <strong>server</strong>.<br />

You can find the OpenJMS product documentation in the /jms/openjms/<br />

docs directory.<br />

Configuring JNDI objects for OpenJMS<br />

Note<br />

Since each partition in BES can host an instance of OpenJMS, there is a dedicated<br />

configuration file, openjms.xml, for each partition. The openjms.xml file contains<br />

information about various OpenJMS connectors and JNDI objects that the instance<br />

hosts.<br />

BES does not support the administration GUI in OpenJMS. You can create and delete<br />

queues for OpenJMS by editing the openjms.xml file.<br />

To add new Queues, Topics or Connection Factories for OpenJMS, you must modify<br />

its configuration file, openjms.xml. To access this file:<br />

1 Select the relevant partition in the left pane.<br />

2 Right-click on the OpenJMS service in the left pane.<br />

3 Select Properties from the drop-down menu.<br />

4 Click on the openjms.xml tab in the right pane to bring it forward.<br />

5 Edit the file to add the JNDI objects.<br />

See the OpenJMS documentation in the /jms/openjms/docs directory<br />

for more details on this file.<br />

The code sample below shows you how to add a Queue and a Topic connection<br />

factory.<br />

■<br />

■<br />

■<br />

■<br />

You can add any number of factories as necessary for your application.<br />

Make sure that each object you add has a unique name so as to avoid being<br />

overwritten in JNDI. The name has to be unique among multiple instances.<br />

You must have at least one TopicConnectionFactory and one<br />

QueueConnectionFactory in the embedded scheme.<br />

If you do not specify a port for the connector, the default port will be used. Refer to<br />

the OpenJMS documentation for details located in /jms/openjms/docs.<br />

230 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!