Java Business Integration

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Toward Integration

Java Business Integration

Steve Vinoski • IONA Technologies

F
or as long as I can remember, an argument reflective infrastructure to transparently adapt that
has been making the rounds in distributed code for persistence, security, transactions, and
computing circles about how best to define other orthogonal qualities and capabilities.
interfaces for distributed elements. Some advocate The POJO approach works well if you’re a Java
the use of an interface definition language (IDL), programmer developing a pure Java system, but
whereas others prefer to use programming lan- what happens when such purity isn’t possible? The
guages directly. (There are even those who prefer world of enterprise integration is often an
to avoid explicitly defining interfaces altogether, “impure” place in which heterogeneous networks
but I’ll ignore that position for now.) include everything from mainframes to blades
Not surprisingly, the Java community has tra- running an amalgam of operating systems and
ditionally sided with the programming language applications. Given that Java is unlikely to be the
approach — arguing, in part, that IDLs are too far only language in use in such settings, there’s a
removed from the languages that developers use clear need to step above individual programming
for implementation, and that the resulting mis- languages and define services at a more abstract
match often makes it difficult to map between the level that applies equally to various scripting,
two. In practice, this means that either the IDL transformation, and programming languages.
forces the developer to use an unnatural program-
ming style, or the interface developer is stuck Integration
defining cumbersome interfaces to match the pro- On the flip side of the coin, traditional enterprise-
gramming language. One of the most blatant integration approaches often leave much to be
examples I’ve personally experienced of this desired. The enterprise application integration
impedance mismatch is the Corba Java-to-IDL (EAI) movement of the late 1990s, for example,
reverse mapping,1 which is intended to let devel- was built mostly around proprietary systems with
opers define Corba interfaces in pure Java and map their own canonical protocols and data formats
the results into Corba IDL. Although the approach operating in centralized hub configurations. To
produces reasonable results for systems defined integrate a system into the hub, administrators had
entirely in Java, the resulting IDL is strange and to purchase an adaptor to convert its protocols and
overly complex, creating further complications if data formats to the hub’s canonical protocols and
it must subsequently be mapped to a language data formats. For any message to get from one
other than Java. integrated system to another, it had to go through
The desire to avoid such mismatches has led, in the hub via at least two protocol and format con-
part, to the development of various approaches versions, which resulted in low overall perfor-
centered on “plain ol’ Java objects” (POJOs). One mance. Support for standards, if any, was often
such example is the Hibernate framework (www. tacked on to EAI products as barely working after-
hibernate.org), which provides developers with thoughts. I attended a talk at a meeting a few years
transparent support for storing Java objects in ago during which an industry analyst stated that,
relational databases. Rather than relying on on average, EAI projects required a minimum
detailed component interfaces or complex object investment of US$500,000 and 18 calendar
hierarchies characteristic of older frameworks, the months of effort before they realized any results.
POJO approach lets developers focus on produc- I don’t know for certain whether those figures were
ing normal Java code, while relying on tools and accurate, but all in all, it’s no secret that much of

IEEE INTERNET COMPUTING 1089-7801/05/$20.00 © 2005 IEEE Published by the IEEE Computer Society JULY • AUGUST 2005 89
Toward Integration

the industry regards EAI as a failed respectively). It also wisely goes beyond gle Java virtual machine (JVM). Ser-
integration strategy that served only to the Java-centric focus in most JSRs and vices can reside outside the JBI envi-
lock customers into single-vendor pro- aims to accommodate implementation ronment and connect into it via bind-
prietary “money pit” systems. alternatives outside the pure Java space. ing components (BCs), or they can
Because of these shortcomings, the The approach underlying JBI is a bit reside within subcontainers, called ser-
service-oriented architecture (SOA), unusual compared to other JSRs in that vice engines (SEs), that live directly
based mainly on Web services, is it uses Web services at its core. Rather within the JBI environment. Services
largely replacing EAI today.2 The defi- than focusing on how to build Web ser- connected into a JBI environment,
nitions and distinctions here are vices using Java, it promotes an archi- whether through an SE or a BC, com-
admittedly murky, however, because it tecture that’s strongly based on Web municate with each other via the nor-
seems that EAI proponents (apparently services’ principles and approaches. malized message router, which is the
having seen the writing on the wall) JBI environment’s primary service.
have recently redefined the term “EAI” JBI Architecture
to incorporate Web services. Fundamentally, JBI is a pluggable Normalized
architecture consisting of a container Message Router
Lessons Learned and plug-ins. The container hosts The NMR mediates message exchanges
Anyone intent on developing a Java- plug-in components that communicate between service consumers and
based framework for enterprise inte- via message routers. Architecturally, providers and can also act as a kind of
gration would do well to keep a few components interact via an abstract discovery service to help consumers
things in mind. One lesson is that service model — a messaging model locate appropriate service providers.
today’s Java programmers want to that resides at a level of abstraction BCs and SEs communicate with the
NMR via delivery channels, which are
objects that provide methods for send-
JBI is an SOA: it treats its components as ing and accepting messages and for
creating message-exchange factories.
service providers and consumers. These factories allow service consumers
to create specific message-exchange
instances for use with target services.
write Java, not stylized or otherwise above any particular protocol or mes- At a minimum, JBI implementa-
“special” Java that must incorporate sage-encoding format. JBI is an SOA: tions are required to support message-
framework-specific artifacts. Another it treats its components as service exchange sequences based on four
lesson is that standardizing a suitable providers and consumers. standard, well-understood WSDL
integration-focused framework would Abstractions are quite useful, of message-exchange patterns (MEPs):
be a good idea, given that the alterna- course, but concrete instances of them
tive is to add yet another proprietary are ultimately necessary to get real • In-only: the service consumer sends
system to a field already rife with work done. JBI uses the Web Services a message to the service provider,
stove-piped solutions that don’t work Description Language (WSDL) for both which provides no response. The
together. The most important lesson, abstract and concrete specification of exchange is complete when the
however, could well be that when it its component messaging model. The provider indicates completion or
comes to integration, Java can’t solve abstract model defines message types error by invoking an API call to set
it all. Making it possible for solutions that service providers and consumers the status of the exchange. With
outside traditional Java programming can exchange, abstract operations this MEP, providers have no way to
to work within the framework is thus comprising those messages, and ser- indicate fault details to consumers.
a necessity, not a nicety. vice types or interfaces that group • Robust in-only: the consumer sends
One standards effort currently tar- related operations together. The con- a message to the provider, which
geting the business-integration space is crete model defines binding types to either sets the exchange status
Java Specification Request 208, entitled specify protocols, endpoints to specify (completing the exchange) or re-
“Java Business Integration” (JBI).3 Like concrete communication details for turns a fault to the consumer, who
other JSRs in the Java Community reaching services, and services that must then set the exchange status
Process (JCP; www.jcp.org), JBI obvi- group related endpoints to specify to complete it.
ously has to work with the Java 2 plat- actual service instances. • In-out: the consumer sends a mes-
form — in this case, both the standard The JBI environment is a collection sage to the provider, which returns
and enterprise editions (J2SE and J2EE, of components that reside within a sin- an output message or a fault. The

90 JULY • AUGUST 2005 www.computer.org/internet/ IEEE INTERNET COMPUTING


Java Business Integration

consumer completes the exchange (XSLT) engines, Business Process Exe- and tried-and-true distributed com-
by setting the exchange status. cution Language (BPEL) systems, and puting approaches for message pro-
• In-optional-out: the consumer even POJOs — whatever can peaceful- cessing to bring some order to the
sends a message to the service ly exist within the JVM hosting the JBI world of business integration. I am
provider, which either returns an environment. Similarly, BCs are free to disappointed, however, that the speci-
output message or fault or com- adapt virtually any kind of protocol or fication doesn’t detail any interfaces
pletes the exchange by setting its format employed by third-party appli- for supporting interceptors4 or filters,
status. If the provider returns a cations or middleware systems, which which are useful for easily creating
fault, the consumer sets the ex- provides an avenue for elements out- message-processing pipelines.
change status to complete it; if the side the JBI environment, including JBI supports the principles of SOA,
provider returns an output, the other JBI environment instances, to in part, by being an SOA itself. It also
consumer can complete the ex- participate in JBI message exchanges. avoids being overly prescriptive, and
change by setting its status, or it thus maintains the needed flexibility
might respond with a fault, in Management to extend Java integration’s reach.
which case the provider must set Because the JBI environment deals The specification chooses a
the exchange status to complete it. with pluggable components, it must reasonable middle ground with respect
also deal with lifecycle and deploy- to the interface-definition issues. JBI’s
To perform these MEPs, consumers ment issues. For example, administra- authors also clearly knew well enough
and providers first create message- tors need to be able to install compo- to avoid EAI’s technical failures, and
exchange instances via message- nents into a JBI environment and to they paid close attention to lessons
exchange factories and then invoke start and stop them for maintenance or learned from the Java Message Service
send and receive operations on the debugging purposes. Such needs are (JMS) and J2EE Connector Architec-
delivery channels. Message-exchange fairly standard requirements for inte- ture (JCA). The end result is that JBI is
instances carry not only messages but gration middleware and distributed solid enough to support interoperable,
also metadata and state information computing systems. enterprise-capable, and practical inte-
for the given exchange. To handle these issues, the JBI gration solutions, which ultimately is
All the messages exchanged environment, not surprisingly, makes what an SOA aims to provide.
through the NMR are normalized mes- use of Java Management Extensions.
sages, which doesn’t imply that all JMX management beans provide func- References
messages are converted to a canonical tions that deal with installation, 1. Java to IDL Language Mapping Specification,
format. As I mentioned, EAI systems deployment, monitoring, and lifecycle version 1.3, Object Management Group,
already proved that translating concerns for the JBI environment Sept. 2003; www.omg.org/docs/formal/03
messages into canonical formats can itself, for BC and SE components that -09-04.pdf.
negatively impact performance, scala- plug into JBI environments, and also 2. S. Vinoski, “Integration with Web Services,”
bility, and the ability to further inte- for subcomponents that might plug IEEE Internet Computing, vol. 7, no. 6, 2003,
grate systems with other integration into SE subcontainers. pp. 75–77.
infrastructures. The NMR avoids these 3. R. Ten-Hove and P. Walker, Java Business
negative impacts by treating message Integration (JBI) 1.0, final release, 24 May
payloads as opaque data that it simply
sends along to the receiver.
The NMR is a classic framework in
T he JBI specification, weighing in at
244 pages, is too rich and detailed
to fully cover in this column space.
2005; www.jcp.org/en/jsr/detail?id=208.
4. S. Vinoski, “Chain of Responsibility,” IEEE
Internet Computing, vol. 6, no. 6, 2002, pp.
the sense that it expects BCs and SEs Instead, my intent here is to provide a 80–83.
plugging into it to fulfill certain inter- feel for what the specification is about
faces and contracts. However, the NMR and explain some of the basics so that Steve Vinoski is chief engineer of product inno-
imposes essentially no constraints on you’ll have some familiarity when you vation for IONA Technologies. He’s been
how BCs or SEs are internally imple- sit down to read it yourself. involved in middleware for more than 17
mented or how they interface with the What impresses me most about the years. Vinoski is coauthor of Advanced
elements they’re integrating. The fact JBI specification are its balance and Corba Programming with C++ (Addison-
that developers can implement SEs as incorporation of lessons from the past. Wesley Longman, 1999), and he has helped
subcontainers implies that they can It avoids trying to invent things — develop middleware standards for the Object
host virtually any type of message something standards should never try Management Group (OMG) and the World
processors, including Extensible to do — and instead relies on existing Wide Web Consortium (W3C). Contact him
Stylesheet Language Transformation standards, such as WSDL and JMX, at vinoski@ieee.org.

IEEE INTERNET COMPUTING www.computer.org/internet/ JULY • AUGUST 2005 91

You might also like