fuse - esb prod intro

42
Fuse ESB Product Introduction Version 4.4.1 Sept. 2011

Upload: irshadulla-kayamkhani

Post on 22-Jul-2016

61 views

Category:

Documents


8 download

DESCRIPTION

Fuse ESB is an open, standards based integration platform. It reduces the complexity of integrating disparateapplications by leveraging the service oriented architecture principles and standardized packaging frameworks.

TRANSCRIPT

Page 1: Fuse - Esb Prod Intro

Fuse ESBProduct Introduction

Version 4.4.1Sept. 2011

Page 2: Fuse - Esb Prod Intro
Page 3: Fuse - Esb Prod Intro

Product IntroductionVersion 4.4.1

Updated: 30 Nov 2011Copyright © 2011 FuseSource Corporation, a Progress Software company. All rights reserved.

Legal Notices

These materials and all Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation.The information in these materials is subject to change without notice, and Progress Software Corporation assumes no responsibilityfor any errors that may appear therein. The references in these materials to specific platforms supported are subject to change.

Actional, Apama, Apama (and Design), Artix, Business Empowerment, DataDirect (and design), DataDirect Connect, DataDirectConnect64, DataDirect Technologies, DataDirect XML Converters, DataDirect XQuery, DataXtend, Dynamic Routing Architecture,EdgeXtend, Empowerment Center, Fathom, FUSE Mediation Router, FUSE Message Broker, FUSE Services Framework,IntelliStream, IONA, Making Software Work Together, Mindreef, ObjectStore, OpenEdge, Orbix, PeerDirect, POSSENET, Poweredby Progress, PowerTier, Progress, Progress DataXtend, Progress Dynamics, Progress Business Empowerment, ProgressEmpowerment Center, Progress Empowerment Program, Progress OpenEdge, Progress Profiles, Progress Results, ProgressSoftware Developers Network, Progress Sonic, ProVision, PS Select, Savvion, SequeLink, Shadow, SOAPscope, SOAPStation,Sonic, Sonic ESB, SonicMQ, Sonic Orchestration Server, SonicSynergy, SpeedScript, Stylus Studio, Technical Empowerment,WebSpeed, Xcalia (and design), and Your Software, Our Technology–Experience the Connection are registered trademarks ofProgress Software Corporation or one of its affiliates or subsidiaries in the U.S. and/or other countries. AccelEvent, ApamaDashboard Studio, Apama Event Manager, Apama Event Modeler, Apama Event Store, Apama Risk Firewall, AppsAlive, AppServer,ASPen, ASP-in-a-Box, BusinessEdge, Business Making Progress, Cache-Forward, DataDirect Spy, DataDirect SupportLink, FUSE,FuseSource, Future Proof, GVAC, High Performance Integration, ObjectStore Inspector, ObjectStore Performance Expert, OpenAccess,Orbacus, Pantero, POSSE, ProDataSet, Progress Control Tower, Progress ESP Event Manager, Progress ESP Event Modeler,Progress Event Engine, Progress RFID, Progress RPM, Progress Software Business Making Progress, PSE Pro, SectorAlliance,SeeThinkAct, Shadow z/Services, Shadow z/Direct, Shadow z/Events, Shadow z/Presentation, Shadow Studio, SmartBrowser,SmartComponent, SmartDataBrowser, SmartDataObjects, SmartDataView, SmartDialog, SmartFolder, SmartFrame, SmartObjects,SmartPanel, SmartQuery, SmartViewer, SmartWindow, Sonic Business Integration Suite, Sonic Process Manager, Sonic CollaborationServer, Sonic Continuous Availability Architecture, Sonic Database Service, Sonic Workbench, Sonic XML Server, The BrainsBehind BAM, WebClient, and Who Makes Progress are trademarks or service marks of Progress Software Corporation and/or itssubsidiaries or affiliates in the U.S. and other countries. Java and all Java-based marks are trademarks or registered trademarksof Sun Microsystems, Inc. in the U.S. and other countries. Any other trademarks contained herein are the property of theirrespective owners.

Third Party Acknowledgments

Fuse ESB v4.3.1 incorporates ASM v3.1 from INRIA, France Telecom. Such technology is subject to the following terms andconditions: ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2005 INRIA, France TelecomAll rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided thatthe following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditionsand the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditionsand the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name ofthe copyright holders nor the names of its contributors may be used to endorse or promote products derived from this softwarewithout specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

Page 4: Fuse - Esb Prod Intro

MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHTOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, ORCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAYOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Fuse ESB v4.3.1 incorporates HSQL Database Engine v1.7.3.3 from Hypersonic SQL Group. Such technology is subject to thefollowing terms and conditions: Hypersonic SQL License Copyright Copyright (c) 1995-2000 by the Hypersonic SQL Group. Allrights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that thefollowing conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions andthe following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and thefollowing disclaimer in the documentation and/or other materials provided with the distribution. All advertising materials mentioningfeatures or use of this software must display the following acknowledgment: "This product includes Hypersonic SQL." Productsderived from this software may not be called "Hypersonic SQL" nor may "Hypersonic SQL" appear in their names without priorwritten permission of the Hypersonic SQL Group. Redistributions of any form whatsoever must retain the following acknowledgment:"This product includes Hypersonic SQL." This software is provided "as is" and any expressed or implied warranties, including, butnot limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall theHypersonic SQL Group or its contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages(including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption).However caused any on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise)arising in any way out of the use of this software, even if advised of the possibility of such damage. This software consists ofvoluntary contributions made by many individuals on behalf of the Hypersonic SQL Group.

Fuse ESB v4.3.1 incorporates JBoss.org – Javassist v3.9.0.GA, The contents of these files are subject to the Mozilla PublicLicense Version 1.1 (the "License") provided below; you may not use this file except in compliance with the License. You mayalso obtain a copy of the License at http://www.mozilla.org/MPL/. Software distributed under the License is distributed on an"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governingrights and limitations under the License. For Javassist v3.9.0.GA, The Original Code is Javassist. The Initial Developer of theOriginal Code is Shigeru Chiba. Portions created by the Initial Developer are Copyright (C) 1999-2008 Shigeru Chiba. All RightsReserved.

Fuse ESB v4.3.1 incorporates ANTLR, Another Tool for Language Recognition v2.7.7 from Terrence Parr. Such technology issubject to the following terms and conditions: SOFTWARE RIGHTS ANTLR 1989-2006 Developed by Terence Parr Partiallysupported by University of San Francisco & jGuru.com. We reserve no legal rights to the ANTLR--it is fully in the public domain.An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR,including the incorporation of ANTLR, or its output, into commercial software. We encourage users to develop software withANTLR. However, we do ask that credit is given to us for developing ANTLR. By "credit", we mean that if you use ANTLR orincorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledgethis fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with theoutput, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code.As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available asthey are completed. The primary ANTLR guy: Terence Parr <[email protected]> <[email protected]>.

Page 5: Fuse - Esb Prod Intro

Table of Contents1. Introducing Fuse ESB ........................................................................................................... 92. The Fuse ESB Architecture .................................................................................................. 13

Architecture Overview ..................................................................................................... 14The Kernel ................................................................................................................... 15Supported Technologies ................................................................................................... 17The Console ................................................................................................................. 18

3. Fuse ESB Basics ............................................................................................................... 19Fuse ESB Directory Structure ............................................................................................ 20Starting and Stopping Fuse ESB ........................................................................................ 22Using the Console .......................................................................................................... 23Running the Examples .................................................................................................... 25Using the Web Console ................................................................................................... 28

4. Deploying a Web Service into Fuse ESB .................................................................................. 31Deploying the Example .................................................................................................... 32Running a client ............................................................................................................ 34Understanding the Example .............................................................................................. 36

Index .................................................................................................................................. 41

5Fuse ESB Product Introduction Version 4.4.1

Page 6: Fuse - Esb Prod Intro

List of Figures2.1. The Fuse ESB Architecture .................................................................................................. 143.1. Available Console Commands .............................................................................................. 233.2. Available shell Commands .................................................................................................. 233.3. Help for the features:list Command ...................................................................................... 243.4. The Web Console ............................................................................................................. 294.1. Example Client HTML Screen .............................................................................................. 34

Fuse ESB Product Introduction Version 4.4.16

Page 7: Fuse - Esb Prod Intro

List of Examples4.1. CXF OSGi Example WSDL .................................................................................................. 324.2. POM Elements for Using Fuse ESB OSGi Tooling ...................................................................... 364.3. OSGi Example Spring Configuration ....................................................................................... 374.4. OSGi POM ...................................................................................................................... 38

7Fuse ESB Product Introduction Version 4.4.1

Page 8: Fuse - Esb Prod Intro

Fuse ESB Product Introduction Version 4.4.18

Page 9: Fuse - Esb Prod Intro

Chapter 1. Introducing Fuse ESBFuse ESB is an open, standards based integration platform. It reduces the complexity of integrating disparateapplications by leveraging the service oriented architecture principles and standardized packaging frameworks.

Overview One of the biggest challenges facing modern enterprises is IT systemintegration. Fuse ESB tackles this problem using a lightweight standardsbased, loosely coupled approach. By relying on standards, Fuse ESB reducesthe chances of vendor lock-in. By advocating loose coupling, Fuse ESB reducesthe complexity of integration.

Integration problems Enterprise networks commonly deploy disparate applications, platforms, andbusiness processes that need to communicate or exchange data with eachother. The applications, platforms and processes have non-compatible dataformats and non-compatible communications protocols. If an enterprise needsto interface with external systems, the integration problem extends outsideof a company and encompasses its business partners' IT systems andprocesses as well.

In recent years, there have been several technologies attempting to solvethese problems such as Enterprise Application Integration (EAI) andBusiness-to-Business (B2B). These solutions addressed some of the integrationproblems, but were proprietary, expensive, and time-consuming to implement.These solutions range from expensive vendor solutions (high cost, vendorlock-in) to home-grown custom solutions (high maintenance, high cost). Theoverwhelming disadvantages of these solutions are high cost and low flexibilitydue to non-standard implementations.

Most recently, Service Oriented Architecture (SOA) has become the hotintegration methodology. SOA attempts to address the shortcomings of theother approaches by advocating the use of standards and the use of looselycoupled interfaces. While, SOA, theoretically, improves the solution, it canbe difficult to implement because vendors are offering tools using proprietarytechnologies and attempting to wrap old solutions in SOA clothing.

The ESB approach An enterprise service bus (ESB) is the back bone of a SOA implementation.There is no canonical definition of an ESB. Wikipedia opens its entry on ESBs(http://en.wikipedia.org/wiki/Enterprise_service_bus) by stating:

An ESB generally provides an abstraction layer on top ofan implementation of an enterprise messaging system,

9Fuse ESB Product Introduction Version 4.4.1

Page 10: Fuse - Esb Prod Intro

which allows integration architects to exploit the value ofmessaging without writing code. Contrary to the moreclassical enterprise application integration (EAI) approachof a monolithic stack in a hub and spoke architecture, thefoundation of an enterprise service bus is built of basefunctions broken up into their constituent parts, withdistributed deployment where needed, working in harmonyas necessary.

—Wikipedia

LooselyCoupled defines an ESB as follows:

An ESB acts as a shared messaging layer for connectingapplications and other services throughout an enterprisecomputing infrastructure. It supplements its coreasynchronous messaging backbone with intelligenttransformation and routing to ensure messages are passedreliably. Services participate in the ESB using either webservices messaging standards or the Java Message System(JMS). Originally defined by analysts at Gartner, ESB isincreasingly seen as a core component in a service-orientedinfrastructure.

—looselycoupled.com

The most common way of defining an ESB is by listing the services it provides.These services include:

• transport mediation - not all services that need to be integrated use HTTPor JMS

• dynamic message transformation - not all services are going to use SOAPand are unlikely to require the same message structures

• intelligent routing

• security

An ESB simplifies the complexity of integration by providing a single, standardsbased infrastructure into which applications can be plugged. Once pluggedinto the ESB, an application or service has access to all of the infrastructureservices provided by the ESB and can access any other applications that arealso plugged into the ESB. For example, you could plug a billing system basedon JMS into an ESB and use the ESBs transport mediation features to exposethe billing system over the Web using SOAP/HTTP. You could also route

Fuse ESB Product Introduction Version 4.4.110

Chapter 1. Introducing Fuse ESB

Page 11: Fuse - Esb Prod Intro

internal POs directly into the billing system by plugging the your PO systeminto the ESB.

Differentiating between ESBimplementations

Most ESB implementations provide all of the services that are used to definean ESB, so it is hard to differentiate ESB implementations based on features.A better way to differentiate between them is to use the following fourmeasures:

Supported deployment / runtime environmentsMany ESB solutions are designed to be deployed into application servers,other heavy weight containers, or proprietary runtime environments.These types of ESB solution is ideal for distributed computing. They alsocontribute to vendor lock-in.

Ideally, an ESB solution should have flexible deployment requirementsso that it can be distributed through out an enterprise.

Container/component modelDoes the ESB solution use a standardized container model, such as J2EE,JBI, or OSGi, for managing deployed services? Or does it use a proprietarymodel?

Ideally, an ESB solution should use a standardized container model.Standard models ensure maximum compatibility and lessen the learningcurve needed for adoption.

Coupling to other infrastructure componentsESB solutions often leave out infrastructure components like orchestrationengines and advanced transports like CORBA. Instead they rely onplug-ins or other components to provided the functionality.

Many ESB solutions require a tight coupling between the ESB and theadded components. This means that you are limited to only using theadded components supplied by the ESB vendor or must learn complexAPIs to extend the ESB yourself.

Ideally, an ESB solution would provide a loose coupling or provide astandardized interface between the ESB and any added components.This allows the ESB to be extended easily and in a flexible manner.

DependenciesESB solutions have a lot of moving parts and complex dependencies.Some ESB solutions handle these dependencies by locking themselvesinto using proprietary solutions for things like security or JMS

11Fuse ESB Product Introduction Version 4.4.1

Page 12: Fuse - Esb Prod Intro

implementations. Others rely on standardized implementations as muchas possible.

Ideally, an ESB solution would only depend on widely availablestandardized libraries to make dependencies easy to manage.

The Fuse ESB approach Based on Apache ServiceMix, Fuse ESB reduces complexity and eliminatesvendor lock in because it is standards based and built using best in breedopen source technology. It differentiates itself in the following ways:

• The Fuse ESB kernel is lightweight and can run on most platforms.

• The Fuse ESB kernel uses the OSGi framework to simplify componentizationof applications.

The OSGi framework is a newly emerging standard for managing thedependencies between application components. It also provides a standardmechanism for controlling the life-cycle of components.

• Fuse ESB supports the Java Business Integration (JBI) specification (JSR208).

JBI is a well defined standard for packaging, deploying, and managingcomponents deployed to the ESB.

• Fuse ESB can be coupled to other infrastructure services over a variety oftransport protocols and message formats.

Out of the box, the Fuse ESB supports JMS, HTTP, HTTPS, FTP, XMPP,Web services, and a number of other bindings. In addition, you can easilyextend its connectivity options using other components that conform toeither the OSGi or JBI specification.

• Fuse ESB employs standards as much as possible to limit dependencies.

In addition, Fuse ESB supports event driven architectures. Services deployedinto the Fuse ESB container can be fully decoupled and will simply listen onthe bus until an appropriate service request arrives. Fuse ESB also supportsevents that occur outside of the bus. For example, a JMS service can listenon a topic that is hosted outside of the bus and only act when an appropriatemessage arrives.

Fuse ESB Product Introduction Version 4.4.112

Chapter 1. Introducing Fuse ESB

Page 13: Fuse - Esb Prod Intro

Chapter 2. The Fuse ESB ArchitectureFuse ESB employs a layered architecture that comprises a kernel, based on Apache Felix Karaf, and a technologylayer.

Architecture Overview ............................................................................................................. 14The Kernel ........................................................................................................................... 15Supported Technologies ........................................................................................................... 17The Console ......................................................................................................................... 18

13Fuse ESB Product Introduction Version 4.4.1

Page 14: Fuse - Esb Prod Intro

Architecture OverviewFuse ESB employs a layered architecture comprised of the following:

KernelA lightweight runtime that extends OSGi with powerful features forhandling and managing OSGi bundles.

Technology layerA layer of component technologies that sits on top of the kernel.

Figure 2.1. The Fuse ESB Architecture

Fuse ESB Product Introduction Version 4.4.114

Chapter 2. The Fuse ESB Architecture

Page 15: Fuse - Esb Prod Intro

The KernelThe Fuse ESB kernel is based on Apache Karaf, an OSGi-based runtime thatprovides a lightweight container into which you can deploy various componentsand applications.

Features The kernel provides the following features:

ConsoleKaraf can be administered via an extensible console shell that supportssecure, remote access.

Dynamic loggingA dynamic logging backend provided by Log4J supports different APIs(JDK 1.4, JCL, SLF4J, Avalon, Tomcat, OSGi).

Hot deploymentWhen a JAR file is added to the InstallDir/deploy folder, it is

automatically installed inside the runtime.

ProvisioningApplication provisioning through file-drop, Maven repository and remotedownload.

Dynamic configurationChanges to the properties files contained in the InstallDir/etc directory

are monitored and propagated to the relevant services.

SecuritySecurity framework based on Java Authentication and AuthorizationService (JAAS).

OSGi in a nutshell OSGi is set of open specifications aimed at making it easier to build anddeploy complex software applications. The key piece of OSGi technology isthe OSGi Framework. The framework manages the loading and managementof dynamic modules of functionality.

In an OSGi environment applications are packaged into bundles. A bundle isa JAR that contains extra information about the classes and resources includedin the bundle. The information supplied in the bundle includes:

15Fuse ESB Product Introduction Version 4.4.1

The Kernel

Page 16: Fuse - Esb Prod Intro

• packages required by classes in the bundle

• packages being exported by the bundle

• version information for the bundle

Using the information in the bundle, the OSGi framework ensures that all ofthe dependencies required by the bundle are present. If it is, the bundle isactivated and made available. The information in the bundle also allows theframework to manage multiple versions of a bundle.

The OSGi specifications are maintained by the OSGi Alliance. See http://www.osgi.org.

For more information about Fuse ESB's OSGi functionality see Deploying intothe OSGi Container.

Benefits of OSGi OSGi offers a number of benefits over other container and packaging modelsincluding:

• Hot deployment of artifacts

• Management of multiple versions of a package, class, or bundle

• Dynamic loading of code

• Lightweight footprint

• Multiple packaging options

Supported OSGi containers Karaf supports the following OSGi 4.2 containers:

• Apache Felix Framework 2.0.0

• Eclipse Equinox 3.5.

In Fuse ESB 4.4.1, the default container is Equinox. To change your OSGicontainer, set the karaf.framework property to felix in theetc/config.properties file.

Fuse ESB Product Introduction Version 4.4.116

Chapter 2. The Fuse ESB Architecture

Page 17: Fuse - Esb Prod Intro

Supported TechnologiesThe technology layer in Fuse ESB supports the following technologies:

JMSApache ActiveMQ message brokers can be deployed and managed asOSGi bundles.

JAX-WS and JAX-RSYou can deploy JAX-WS and JAX-RS RESTful web services built usingApache CXF.

CamelYou can implement enterprise integration patterns in Apache Camel anddeploy them in Fuse ESB

JBIYou can deploy Java Business Integration (JBI) 1.0 service assembliesand service units in Fuse ESB. See Using Java Business Integration fordetails.

BlueprintBlueprint is a dependency-injection framework that is optimized for theOSGi container. It enables you to define Camel routes, JMS endpoints,Web service endpoints and OSGi services using XML syntax. It is similarto the Spring framework, but is more lightweight.

Spring frameworkYou can add any Spring configuration file to the deploy directory and

Fuse ESB will generate an OSGi bundle on the fly and instantiate theSpring application context.

17Fuse ESB Product Introduction Version 4.4.1

Supported Technologies

Page 18: Fuse - Esb Prod Intro

The Console

Overview The Fuse ESB console is a shell environment, based on Apache Felix Gogo,that enables you to control the Fuse ESB runtime. For details on the Gogoshell, see http://felix.apache.org/site/apache-felix-gogo.html.

The Console Reference provides information about using the console andincludes descriptions of the available commands.

Features The Fuse ESB console provides the following features:

ExtensibleYou can expand the the functionality of the shell by writing custommodules.

Artifact ManagementOne of the most important uses of the command console is managingthe artifacts deployed into the container. The command console providessubshells to manage artifacts, including OSGi bundles, collections ofbundles, JBI artifacts, and OSGi bundle repositories (OBRs).

Remote ManagementYou will likely have many instances of the Fuse ESB runtime distributedthroughout your organization. To address this requirement, the commandconsole includes the commands ssh and sshd, which enable you to

connect to and start a remote secure shell server.

See "Using Remote and Child Instances of the Runtime" in Configuringand Running Fuse ESB for more information about remote connections.

Fuse ESB Product Introduction Version 4.4.118

Chapter 2. The Fuse ESB Architecture

Page 19: Fuse - Esb Prod Intro

Chapter 3. Fuse ESB BasicsOnce you have installed Fuse ESB, this chapter will help you get to know the basics of the product.

Fuse ESB Directory Structure .................................................................................................... 20Starting and Stopping Fuse ESB ................................................................................................ 22Using the Console .................................................................................................................. 23Running the Examples ............................................................................................................ 25Using the Web Console ........................................................................................................... 28

19Fuse ESB Product Introduction Version 4.4.1

Page 20: Fuse - Esb Prod Intro

Fuse ESB Directory StructureThe directory layout of an installed Fuse ESB system is as follows:

• /ant—contains files related to the Ant tasks that Fuse ESB supports as

part of its compliance to the JBI specification

• /bin—startup scripts

• /conf—install log

• /data—cached information and log files

• /cache—cached bundles loaded by the OSGi container at runtime

• /generated-bundles—generated bundles created by the kernel. For

example, if you drop a non-OSGi enabled WAR file into the deploydirectory, an OSGi bundle will be generated here.

• /log—log files

If you want to reset the runtime's environment to the default, you can justdelete the data directory. The next time Fuse ESB is started up it will createa new data directory.

• /deploy—hot deploy directory

• /etc—kernel and bundle configuration files

• /examples—contains example code that demonstrates the available

functionality in Fuse ESB

• /instances—contains a directory for each child instance created using

the admin:create command. See "Managing Child instances" in Configuringand Running Fuse ESB for details.

• /lib—contains the bootstrap libraries

• /system—contains the OSGi bundles to be installed at runtime, organized

as a Maven 2 repository. By default, Fuse ESB first checks this folder when

Fuse ESB Product Introduction Version 4.4.120

Chapter 3. Fuse ESB Basics

Page 21: Fuse - Esb Prod Intro

resolving a required artifact, before checking the user's local Mavenrepository.

21Fuse ESB Product Introduction Version 4.4.1

Fuse ESB Directory Structure

Page 22: Fuse - Esb Prod Intro

Starting and Stopping Fuse ESB

Starting To start Fuse ESB:

1. Make sure that the JAVA_HOME environment variable is set.

2. In a command prompt or terminal, change to the InstallDir/bin

directory.

3. Type:

Windows

servicemix.bat

*NIX

./servicemix

The ServiceMix logo and karaf> prompt appear in your terminal window:

____ _ __ __ _/ ___| ___ _ ____ _(_) ___ ___| \/ (_)_ __\___ \ / _ \ '__\ \ / / |/ __/ _ \ |\/| | \ \/ /___) | __/ | \ V /| | (_| __/ | | | |> <|____/ \___|_| \_/ |_|\___\___|_| |_|_/_/\_\

Apache ServiceMix (4.1.0-psc-01-00)

Hit '<tab>' for a list of available commandsand '[cmd] --help' for help on a specific command.

karaf@root>

Stopping To stop Fuse ESB, do one of the following at the karaf> prompt:

• Type osgi:shutdown or simply shutdown

• Press Ctrl+D

Fuse ESB Product Introduction Version 4.4.122

Chapter 3. Fuse ESB Basics

Page 23: Fuse - Esb Prod Intro

Using the Console

Viewing available commands To see a list of the available commands in the console press the Tab key atthe karaf> prompt.

Figure 3.1. Available Console Commands

activemq:browse activemq:bstat activemq:create-brokeractivemq:destroy-broker activemq:list activemq:purgeactivemq:query admin:change-port admin:connectadmin:create admin:destroy admin:listadmin:start admin:stop config:cancelconfig:edit config:list config:propappendconfig:propdel config:proplist config:propsetconfig:update dev:dynamic-import dev:frameworkdev:show-tree features:addUrl features:installfeatures:list features:listUrl features:refreshUrlfeatures:removeUrl features:uninstall jbi:listjbi:shutdown jbi:start jbi:stoplog:display log:display-exception log:getlog:set nmr:list osgi:bundle-levelosgi:headers osgi:install osgi:listosgi:ls osgi:refresh osgi:resolveosgi:restart osgi:shutdown osgi:startosgi:start-level osgi:stop osgi:uninstallosgi:update packages:exports packages:importsshell:cat shell:clear shell:eachshell:echo shell:exec shell:grepshell:if shell:info shell:javashell:printf shell:sleep shell:sortshell:tac ssh:ssh ssh:sshd

To see a list of commands in a particular command grouping, type thecommand prefix, for example shell or osgi and then press Tab.

Figure 3.2. Available shell Commands

shell:cat shell:clear shell:each shell:echoshell:execshell:grep shell:if shell:info shell:java

23Fuse ESB Product Introduction Version 4.4.1

Using the Console

Page 24: Fuse - Esb Prod Intro

shell:printfshell:sleep shell:sort shell:tac

Getting help on a command To view help on a particulare command, type the command followed by--help. For example,

Figure 3.3. Help for the features:list Command

karaf@root> features:list --helpDESCRIPTION

features:list

Lists all existing features available from the defined repositories.

SYNTAXfeatures:list [options]

OPTIONS--help

Display this help message-i, --installed

Display a list of all installed features only

Fuse ESB Product Introduction Version 4.4.124

Chapter 3. Fuse ESB Basics

Page 25: Fuse - Esb Prod Intro

Running the ExamplesFuse ESB comes with a range of examples that demonstrates product's thekey functionality. These examples are stored in the InstallDir/examplesfolder. Instructions for running and building each example are contained inthe readme file at the root of each example folder.

Before running the examples To run the examples you will need to do the following:

1. Make sure that you have Apache Maven 2.2.1 or later installed.

You can download Maven from http://maven.apache.org/.

2. Ensure that the M2_HOME environment variable is set to your Maven

installation directory.

3. Increase the amount of memory available to Maven by setting theMAVEN_OPTIONS environment variable as follows:

UNIX

export MAVEN_OPTS=-Xmx768m

Windows

set MAVEN_OPTS=-Xmx768m

4. Start an instance of the Fuse ESB.

Building the examples To build all the examples in the examples folder:

1. In a command prompt or terminal, change to the InstallDir/examples

directory.

25Fuse ESB Product Introduction Version 4.4.1

Running the Examples

Page 26: Fuse - Esb Prod Intro

2. Type mvn install

Deploying examples Once you have built an example, you can deploy it by copying the JAR filegenerated in the example's target directory to the InsallDir/deploy folder.

Installing examples features Several of the examples make use of the Fuse ESB features facility. A featureis a named, versioned collection of OSGi bundles that work together to providesome functionality.

Fuse ESB includes a number of features that make the running of the examplesquick and easy. Each feature enables you to use a single command to installthe example bundle and any bundles that the example depends on.

To view a list of the features that are used by the examples, enter the followingcommand in the Fuse ESB console:

features:list | grep examples

A list of examples features is returned:

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-osgirepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-jaxrsrepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-nmrrepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-camel-osgirepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-camel-nmrrepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-camel-nmrrepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-ws-addressingrepo-0

[uninstalled] [4.1.0-psc-01-00 ] examples-cxf-wsdl-first-osgi-packagerepo-0[uninstalled] [1.1.0-psc-01-00 ] examples-nmr

repo-0

To install an examples feature, use the features:install command, as shown:

Fuse ESB Product Introduction Version 4.4.126

Chapter 3. Fuse ESB Basics

Page 27: Fuse - Esb Prod Intro

features:install examples-cxf-osgi

27Fuse ESB Product Introduction Version 4.4.1

Running the Examples

Page 28: Fuse - Esb Prod Intro

Using the Web ConsoleThe Apache Karaf Web Console provides you with a graphical overview ofyour Fuse ESB installation.

You can use it to:

• Install and uninstall features

• Stop, start, and uninstall bundles

• Create new instances of Fuse ESB

• Configure your Fuse ESB instance

• View logging information

Installing the web console feature The web console is not installed by default. To install it, run the followingfrom the karaf> prompt:

features:install webconsole

Accessing the web console By default, the console runs on port 8181. You can change the port numberby creating the properties file, etc/org.ops4j.pax.web.cfg, and addingthe following property setting (changing the port number to whatever valueyou want):

org.osgi.service.http.port=8181

To access the console for an instance of Fuse ESB running locally, enter thefollowing address in your web browser:

http://localhost:8181/system/console

Log in with the username smx and the password smx.

WarningOnce you enable the web console, your Fuse ESB will be accessiblevia HTTP from a remote machine. For this reason, we recommendthat you change the default username and password in the

Fuse ESB Product Introduction Version 4.4.128

Chapter 3. Fuse ESB Basics

Page 29: Fuse - Esb Prod Intro

etc/users.properties file. See "Configuring JAAS Security" inConfiguring and Running Fuse ESB for details.

Figure 3.4. The Web Console

29Fuse ESB Product Introduction Version 4.4.1

Using the Web Console

Page 30: Fuse - Esb Prod Intro

Fuse ESB Product Introduction Version 4.4.130

Page 31: Fuse - Esb Prod Intro

Chapter 4. Deploying a Web Serviceinto Fuse ESBHere we will take an indepth look at the CXF OSGi example, a JAX-WS web service packaged as an OSGi bundle.

Deploying the Example ............................................................................................................ 32Running a client .................................................................................................................... 34Understanding the Example ...................................................................................................... 36

You are going to build and deploy a simple service that is based on a WSDLdocument. The source for this example can be found in theInstallDir/examples/cxf-osgi folder of your Fuse ESB installation.

The example uses the Fuse ESB Maven tooling to build a bundle that containsthe service implementation and all of the metadata needed to deploy it intothe Fuse ESB container.

The sample code includes a web page, client.html, that will allow you toaccess the service once it is exposed.

31Fuse ESB Product Introduction Version 4.4.1

Page 32: Fuse - Esb Prod Intro

Deploying the ExampleBefore you run the example, start Fuse ESB.

Installing a prebuilt version of theexample

To install and run a prebuilt version of this example, enter the followingcommand in the Fuse ESB console:

features:install examples-cxf-osgi

Building and deploying theexample yourself

To build and deploy the example do the following:

1. If you installed the examples-cxf-osgi feature, first uninstall it by runningthe following from the Fuse ESB console:

features:uninstall examples-cxf-osgi

2. In a separate command window or terminal, change to the root folderof the example.

cd InstallDir/examples/cxf-osgi

3. Enter the following command:

mvn install

This command will build a bundle calledcxf-osgi-4.4.1-fuse-00-08.jar and place it into the target folderof the example.

4. Copy the bundle to InstallDir/deploy to deploy it to the container.

Testing the example To see if the example is running you can visit http://localhost:8181/cxf/HelloWorld?wsdl in your Web browser. You should see the WSDL shown inExample 4.1 on page 32.

Example 4.1. CXF OSGi Example WSDL

<wsdl:definitions name="HelloWorldImplService"targetNamespace="http://cxf.examples.servicemix.apache.org/">

<wsdl:types><xs:schema attributeFormDefault="unqualified"

elementFormDefault="unqualified"

Fuse ESB Product Introduction Version 4.4.132

Chapter 4. Deploying a Web Service into Fuse ESB

Page 33: Fuse - Esb Prod Intro

targetNamespace="http://cxf.examples.servicemix.apache.org/"><xs:complexType name="sayHi"><xs:sequence><xs:element minOccurs="0" name="arg0" type="xs:string"/></xs:sequence>

</xs:complexType><xs:complexType name="sayHiResponse"><xs:sequence><xs:element minOccurs="0" name="return" type="xs:string"/>

</xs:sequence></xs:complexType><xs:element name="sayHi" nillable="true" type="sayHi"/><xs:element name="sayHiResponse" nillable="true" type="sayHiResponse"/>

</xs:schema></wsdl:types><wsdl:message name="sayHiResponse"><wsdl:part element="tns:sayHiResponse" name="parameters"></wsdl:part>

</wsdl:message><wsdl:message name="sayHi"><wsdl:part element="tns:sayHi" name="parameters"></wsdl:part>

</wsdl:message><wsdl:portType name="HelloWorld"><wsdl:operation name="sayHi"><wsdl:input message="tns:sayHi" name="sayHi"></wsdl:input><wsdl:output message="tns:sayHiResponse" name="sayHiResponse"></wsdl:output>

</wsdl:operation></wsdl:portType><wsdl:binding name="HelloWorldImplServiceSoapBinding" type="tns:HelloWorld"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="sayHi"><soap:operation soapAction="" style="document"/><wsdl:input name="sayHi"><soap:body use="literal"/>

</wsdl:input><wsdl:output name="sayHiResponse"><soap:body use="literal"/>

</wsdl:output></wsdl:operation>

</wsdl:binding><wsdl:service name="HelloWorldImplService"><wsdl:port binding="tns:HelloWorldImplServiceSoapBinding" name="HelloWorldImplPort"><soap:address location="http://localhost:8181/cxf/HelloWorld"/>

</wsdl:port></wsdl:service>

</wsdl:definitions>

33Fuse ESB Product Introduction Version 4.4.1

Deploying the Example

Page 34: Fuse - Esb Prod Intro

Running a clientYou can run either a web client or a Java client against the deployed webservice.

Running the web client To run the web client:

1. Open the client.html, which is located at the root of the cxf-osgi

example folder.

2. Click the Send button to send a request.

Figure 4.1. Example Client HTML Screen

Once the request has been successfully sent, a response message appearsin the right-hand panel of the web page

Running the Java client To run the Java client:

1. In a command prompt or terminal, change to theInstallDir/examples/cxf-osgi directory.

2. Run the following command:

mvn compile exec:java

Fuse ESB Product Introduction Version 4.4.134

Chapter 4. Deploying a Web Service into Fuse ESB

Page 35: Fuse - Esb Prod Intro

If the client request is successful, a response similar to the following isreturned to the command window:

the response is =====><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxf.examples.servicemix.apache.org/"><return>Hello John Doe</return></ns2:sayHiResponse></soap:Body></soap:Envelope>

35Fuse ESB Product Introduction Version 4.4.1

Running a client

Page 36: Fuse - Esb Prod Intro

Understanding the Example

Overview The example builds a simple HelloWorld service and packages it fordeployment into Fuse ESB. The service is written using standard JAX-WSAPIs. It implements a single operation sayHi(). Once deployed, the serviceis exposed as a SOAP/HTTP endpoint. The most interesting parts of theexample are the Spring configuration used to configure the endpoint and theMaven POM used to build the bundle.

The Spring configuration provides the details needed to expose the serviceusing SOAP/HTTP. It can also contain details used to configure advancedApache CXF functionality.

The Maven POM, in addition to compiling the code, uses the bundle generationplug-in to package the resulting classes into an OSGi bundle. It contains allof the details needed by the Fuse ESB container to activate the bundle anddeploy the packaged service.

Using the Maven tools The Fuse ESB Maven tooling automates a number of the steps in packagingfunctionality for deployment into Fuse ESB. In order to use the Maven OSGitooling, you add the elements shown in Example 4.2 on page 36 to yourPOM file.

Example 4.2. POM Elements for Using Fuse ESB OSGi Tooling

...<pluginRepositories><pluginRepository>

<id>fusesource.m2</id><name>ESB Open Source Community Release Repository</name><url>http://repo.fusesource.com/maven2</url><snapshots>

<enabled>false</enabled></snapshots><releases>

<enabled>true</enabled></releases>

</pluginRepository></pluginRepositories>...<build>

<plugins><plugin><groupId>org.apache.felix</groupId>

Fuse ESB Product Introduction Version 4.4.136

Chapter 4. Deploying a Web Service into Fuse ESB

Page 37: Fuse - Esb Prod Intro

<artifactId>maven-bundle-plugin</artifactId>...

</plugin></plugins>

</build>...

These elements point Maven to the correct repositories to download the FuseESB Maven tooling and load the plug-in that implements the OSGi tooling.

The Spring configuration The Fuse ESB container needs some details about a service before it caninstantiate and endpoint for it. Apache CXF uses Spring based configurationto define endpoints for services. The configuration shown inExample 4.3 on page 37 is stored in the example's\src\main\resources\META-INF\spring\beans.xml file.

Example 4.3. OSGi Example Spring Configuration

<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:jaxws="http://cxf.apache.org/jaxws"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml" /> ❶<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /><import resource="classpath:META-INF/cxf/cxf-extension-http.xml" /><import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />

<jaxws:endpoint id="helloWorld" ❷implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl"address="/HelloWorld"/>

</beans>

The configuration shown in Example 4.3 on page 37 does the following:

❶ Imports the required configuration to load the required parts of theApache CXF runtime.

❷ Configures the endpoint that exposes the service using thejaxws:endpoint element and its attributes.

• id is an identifier used by the configuration mechanism.

37Fuse ESB Product Introduction Version 4.4.1

Understanding the Example

Page 38: Fuse - Esb Prod Intro

• implementor specifies the class that implements the service. It must

be on the classpath.

• address specifies the address at which the service will be exposed.

This address is relative to the containers HTTP address with cxf

appended to it.

The POM Example 4.4. OSGi POM

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent><groupId>org.apache.servicemix.examples</groupId><artifactId>examples</artifactId><version>4.4.1-fuse-00-08</version>

</parent>

<groupId>org.apache.servicemix.examples</groupId><artifactId>cxf-osgi</artifactId><packaging>bundle</packaging><version>4.4.1-fuse-00-08</version><name>Apache ServiceMix Example :: CXF OSGi</name>

<!-- Add ServiceMix repositories for snaphots and releases -->...

<dependencies><dependency>

<groupId>org.apache.geronimo.specs</groupId><artifactId>geronimo-ws-metadata_2.0_spec</artifactId><version>${geronimo.wsmetadata.version}</version>

</dependency></dependencies>

<build><plugins>

<plugin><groupId>org.apache.felix</groupId><artifactId>maven-bundle-plugin</artifactId><configuration>

<instructions>

Fuse ESB Product Introduction Version 4.4.138

Chapter 4. Deploying a Web Service into Fuse ESB

Page 39: Fuse - Esb Prod Intro

<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName><Import-Package>

javax.jws,javax.wsdl,META-INF.cxf,META-INF.cxf.osgi,org.apache.cxf.bus,org.apache.cxf.bus.spring,org.apache.cxf.bus.resource,org.apache.cxf.configuration.spring,org.apache.cxf.resource,org.apache.servicemix.cxf.transport.http_osgi,org.springframework.beans.factory.config

</Import-Package><Private-Package>org.apache.servicemix.examples.cxf</Private-Package>

<Require-Bundle>org.apache.cxf.cxf-bundle</Require-Bundle></instructions>

</configuration></plugin>

</plugins></build>

</project>

39Fuse ESB Product Introduction Version 4.4.1

Understanding the Example

Page 40: Fuse - Esb Prod Intro

Fuse ESB Product Introduction Version 4.4.140

Page 41: Fuse - Esb Prod Intro

IndexAApache Felix Framework, 16Apache Karaf, 15Apache Maven, 25Apache ServiceMix, 12architecture, 13

BB2B (see business-to-business)business-to-business, 9

Cconsole, 18, 23

Ddirectory strucuture, 20

EEAI (see enterprise application integration)Eclipse Equinox, 16enterprise application integration, 9enterprise service bus, 9ESB (see enterprise service bus)examples, 25

Iintegration, 9

Kkernel, 15

MMaven tooling, 36

OOSGi, 15

Sservice oriented architecture, 9shell (see console)starting, 22stopping, 22

41Fuse ESB Product Introduction Version 4.4.1

Page 42: Fuse - Esb Prod Intro

Fuse ESB Product Introduction Version 4.4.142