Book Image

Service Oriented Java Business Integration

Book Image

Service Oriented Java Business Integration

Overview of this book

Table of Contents (23 chapters)
Service Oriented Java Business Integration
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

Preface

You're all in the business of software development. Some of you are architects and developers while few others are technology managers and executives. For many of you, ESB is encroaching and JBI is still an unknown—a risk previously avoided but now found to be inescapable. Let us tame these buzzwords in the context of SOA and Integration.

While you do the day to day programming for solving business problems, you will be generating business code as well as business integration code. The traditional Java/J2EE APIs provide you with enough tools and frameworks to do the business coding. The business code will help you to implement a business service such as creating orders or finding products. On the contrary, business integration code wires together multiple applications and systems to provide seamless information flow. It deals with patterns of information exchange across systems and services, among other things. This is where the new Java API for Integration—Java Business Integration (JBI) seeks attention.

JBI provides a collaboration framework which has standard interfaces for integration components and protocols to plug into, thus allowing the assembly of Service Oriented Integration (SOI) frameworks following the Enterprise Service Bus (ESB) pattern. JBI is based on JSR 208, which is an extension of Java 2 Enterprise Edition (J2EE). The book first discusses the various integration approaches available and introduces ESB, which is a new architectural pattern which can facilitate integrating services. In doing so, we also introduce ServiceMix, an Apache Open Source Java ESB. Thus for each of the subsequent chapters, we limit our discussion to a major concern which we can address using ESB and then also showcase this with samples which you can run using ServiceMix. If you are a person with a non-Java background, the book still benefits you since most of the integration wiring happens in XML configuration files.

The aim of this book is to prepare an architect or developer for building integration solutions using ESB. To that end, this book will take a practical approach, emphasizing how to get things done in ServiceMix with code. On occasions, we will delve into the theoretical aspects of ESB, and such discussions will always be supplemented with enough running samples. The book, thus, attempts to distill some of the knowledge that has emerged over the last decade in the realm of Java Integration. Quite different from the other books in the related topics, you don't need a 4GB RAM or some heavy, vendor specific IDE/Workshops to run the samples. Instead, get set with the latest JDK and a text editor and few other lightweight frameworks including Tomcat and you are ready to go. Enough about the hype, supplement with what you've heard with some substance and code.

Happy Reading!

What This Book Covers

Chapter 1 begins with a quick tour on Enterprise Integration and the associated issues so that you can better understand the problem which we are trying to solve, rather than following a solution for an unknown problem. We also introduce Enterprise Service Bus (ESB) architecture and compare and contrast that with other integration architectures.

Chapter 2 introduces Java Business Integration (JBI) and inspects the need for another standard for Business Integration, and also looks into the details on what this standard is all about.

Chapter 3 introduces ServiceMix, which is an open source ESB platform in the Java programming language, built from the ground up with JBI APIs and principles. It runs through a few other ESB products also.

Chapter 4 looks at how we have been binding services locally or remotely even before the ESB became popular. The chapter will demonstrate how tunneling using conventional J2EE tools will help to expose even technology-specific API services. An example of such a service is an EJB service to be exposed through firewalls over HTTP so that the service becomes technology agonistic.

Chapter 5 introduces XFire, which is a new generation Java SOAP framework to easily expose web services. Here we demonstrate the integration capabilities of the XFire. Then we can do integration using XFire within the JBI Architecture also.

Chapter 6 teaches you JBI packaging and deployment. After going through this chapter the reader will be able to build, package, and deploy integration artifacts as standard JBI packages into the JBI container.

Chapter 7 teachs you how to create your own components and deploy them onto the JBI container. This chapter visits the core API from the ServiceMix as well as from the JBI specification which will function as useful helper classes using which you can develop integration components quickly.

Chapter 8 shows you how to bind Enterprise Java Beans components to the ESB. EJB is the Distributed Component paradigm in the Java-J2EE world and the industry has a lot invested in this technology. Coexisting services with those components will help you to reuse those existing investments so that we can continue building new systems based on higher levels of SOA maturity.

Chapter 9 shows POJO Binding using JSR181 to the ESB. POJO components can be easily exposed as WSDL-compliant services to the JBI bus.

Chapter 10 illustrates how to bind the web services to the ServiceMix ESB, thus creating a web services gateway at the ESB layer.

Chapter 11 looks at how Java Message Service (JMS), which is a platform dependent messaging technology, can increase the QOS features of web services by making web services accessible through the JMS channel.

Chapter 12 introduces Java XML binding and XStream, which is a simple open source library to serialize the Java objects to XML and back again. We will show the XStream integration with ESB demonstrating streaming of data across the bus.

Chapter 13 visits the JDK Proxy classes and then explains the JBI Proxy in detail with examples. We show a practical use of the JBI Proxy—Proxying the external web services in the JBI bus.

Chapter 14 explains versioning in the SOA context and explains various strategies and approaches to versioning services. It also explains and demonstrates a versioning sample leveraging the targetNamespace attribute. Versioning services, especially versioning of web services, is a topic of heated discussion in many forums and sites.

Chapter 15 explains that the EAI patterns are nuggets of advice made out of aggregating basic Message Exchange Pattern elements to solve frequently recurring integration problems. We can look at EAI patterns as design patterns for solving integration problems. This chapter will demonstrate many of the common EAI patterns.

Chapter 16 looks into a sample use case. One of the useful applications of ESB is to provide a "Services Workbench" wherein which we can use various integration patterns available to aggregate services to carry out the business processes.

Chapter 17 visits a few selected QOS features such as Transactions, Security, Clustering, and Management which can impact the programming and deployment aspects using ESB.

What You Need for This Book

To install and run most of the samples mentioned in this book all you need is the following:

  • Latest Java SDK (JDK) installed in your machine.

  • Apache Open Source Enterprise Service Bus—ServiceMix.

  • Apache Ant build tool.

  • A simple text editor, like Textpad.

  • Any other software required is mentioned which is downloadable free from the net.

Who is This Book for

This book is aimed at Java developers and integration architects who want to become proficient with Java Business Integration (JBI) standard. They are expected to have some experience with Java and to have developed and deployed applications in the past, but need no previous knowledge of JBI. The book can also be useful to anyone who has been struggling to understand ESB and how it differs from other architectures and to understand its position in SOA.

This book primarily targets IT professionals in the field of SOA and Integration solutions—in other words, intermediate to advanced users. You are likely to find the book useful if you fall into any of the following categories:

  • A programmer, designer or architect in Java who wants to learn and code in JBI or ESB.

  • A programmer, designer or architect who doesn't normally code in Java can still benefit from this book, since we 'assemble integration components' using XML with little to no Java code.

  • An IT Manager or an Officer who knows well about SOA or SOI but want to see something in code (you can adorn your flashy presentations with some live code too).

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "For example, inside the<component> tag you can configure properties on the component."

A block of code will be set as follows:

<target name="run">
<java classname="HttpInOutClient" fork="yes" failonerror="true">
<classpath refid="classpath"/>
<arg value="http://localhost:8912/EsbServlet/hello/"/>
<arg value="HttpSoapRequest.xml"/>
</java>
</target>

Any command-line input and output is written as follows:

cd ch03\Servlet
ant

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "The components being initialized, in our case, include trace, timer, httpGetData, and httpReceiver."

Note

Important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to, making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/files/code/4404_Code.zip, to directly downlad the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata are added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.