156 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
6.4.3 Enabling the EIS component using JMS
In our approach for EIS integration, the EIS component is called from a system
process that is implemented using BPEL technology. WebSphere Studio
Application Developer Integration Edition provides a number of tools to create
services from artifacts such as Java classes and EJBs. The service definitions
are kept in three WSDL files: interface definition, binding details, and service
location details. Furthermore, the tool provides wizards to generate different
service bindings for various technologies (for example, EJB, JMS, and SOAP
Web services). The service WSDL file that describes the actual location of the
service can be easily imported into a BPEL process as a BPEL partner link.
We evaluated the different options to enable the EIS component to be called
from a BPEL system process. We recommend that you use the service
enablement wizards if EJB binding is required. If JMS binding is needed, we
found that development of JMS artifacts such as sender beans and
message-driven EJBs is a better approach. In our view, JMS enabling the EIS
component by manually creating JMS code has the following advantages:
???? JMS APIs are called directly and no WSIF calls are required, which means
there is no overhead that may lead to performance issues
???? The architect and developer have more options to select the message type
and format of the data that is sent over the wire
???? JMS connection factories, destinations, and interaction parameters can be
defined more easily
???? JMS topics can be used to broadcast messages to multiple EIS components
For the Trader EIS component, we have developed an MDB that calls the Trader
Integration session bean. Example 6-5 on page 157 shows the onMessage()
method for the bean. We chose to send serialized Java objects that are
encapsulated in the JMS message type ObjectMessage. The Java data type that
is accepted as input is a StockOrderRequest business object. The
TraderIntegration session bean is called using its local interface.
When creating the MDB using the EJB Creation wizard, you are asked to enter a
name for the JMS listener port. A JMS listener is a WebSphere specific notion of
the queue the MDB listens to. You need to configure the JMS listener port for the
WebSphere test environment.
Having created a test server, you open its configuration editor by double-clicking
the test server in Server Configuration view. First, go to the JMS tab to set up
JMS connection factories and destinations. Make sure that you enter the
destination to the list of queues at the top of the editor window. Click Add in the
EJB tab of the editor to set up the JMS listener ports. Make sure that you select
to start the port in the JMS listener creation wizard.