|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (1)
View Page History* The *Deployment Service* role is to manage the deployment (and provide the lifecycle information) of the service assemblies. The service units bundled into the service assemblies are deployed to the right component by this service implementation. As a result, JBI service consumers and providers are activated in the JBI and Petals ESB environment.
h1. Petals ESB JBI Implementation
The current section introduces how JBI artifacts are used in the Petals ESB JBI container and how they help to instanciate the SOA.
The Petals ESB container is based on the JBI 1.0 specification and has been certified as a JBI compliant container by SUN MicroSystems. This certification has been obtained by running the official SUN JBI test suite with Petals ESN as JBI runtime. This suite tests that all the features defined in the specification are well implemented.
In this section, a 'container service' is a software service which is provided by the container like, for example, the message routing, the exchange security. A 'JBI service' is a service created from a JBI artefact which is used to send, receive and potentially process JBI messages.
h2. The Petals ESB JBI Container
The JBI container is a Java based library which can be used in several forms such as standalone server, embedded in an entreprise application server, embedded in a standard Java application, … . The JBI container is generally called 'kernel' in Petals ESB and implements all the JBI specification.
There is no container lifecycle defined in the JBI specification. Starting Petals ESB instantiates all the software services needed to welcome the JBI artefacts, exchange messages between JBI services and some additional features which will be detailed later in this document.
The JBI container can be seen as a service container and like a web application container, a JBI container is not useful when used alone. To use the container, artifacts needs to be installed/deployed into the container with the help of management operations.
!worddavc3723c62cf5ef8ebc9f28ff4b258f67d.png|height=207,width=399,thumbnail!
h2. Using a JBI Component
The Petals ESB components are packaged as ZIP archives which contains the following files :
{noformat}
+ META-INF
- jbi.xml
- petals-COMPONENT-NAME.jar
- a.jar
- b.jar
{noformat}
COMPONENT-NAME is the name of the component. This JAR file contains the classes which implements the JBI component interface. The other JAR files are third party libraries which are used by the component implementation.
The JBI component must be installed in the JBI container. The container handles the component and its descriptor file (the jbi.xml file) which defines JBI properties such the name, the type (binding component or service engine) and component specific properties. The component properties will ne used by the component implementation to configure the component (a pool size, a socket address, …).
The Java classes, which are packaged into the component, are used to create the component class loader and the container links the component to the container with a context and the delivery channel used to send and receive JBI messages. Once these steps are achieved, the component is started but it can not receive and process JBI messages.
!worddava674ce6d5c412478c832a11fbadb152a.png|height=228,width=367!
h2. Using a JBI Service Unit
The Petals ESB Service Units are packaged as ZIP archives which contains the following files :
{noformat}
+ META-INF
- jbi.xml
- Service.wsdl
{noformat}
The service unit is used to activate consumer or provider endpoints on JBI components. When the service unit is deployed on the container, this one will create an endpoint with the information provided in the service unit descriptor (jbi.xml file). A service provider endpoint is defined by a service name, an interface name, an endpoint name, a WSDL description (locally from the service unit or remotely with an URL) and some additional properties.
Once deployed, the messages, which are sent to the endpoint, will be delivered to the component the service unit is deployed on. It is up to the component to process the message and to return a message, a response, a fault, or nothing.
Processing a message is specific to the component implementation and is not defined in the service unit :
* A binding component will generally transform the message into another format (for example to a SOAP message) and do its job (for example invoking an external Web Service).
* A service engine will get the message and processes it (orchestration, transformation, apply rules). The engine will also potentially invoke other JBI services.
The service unit can not be used alone since the component to deploy the service unit onto is not defined in its descriptor.
!worddavb3d29239facf554948aa9d78c65c9d25.png|height=229,width=367!
h2. Using a JBI Service Assembly
The Petals ESB Service Assemblies are packaged as ZIP archives which contains the following files :
{noformat}
+ META-INF
- jbi.xmlsu-A.zip
- su-N.zip
{noformat}
The service assembly contains a collection of service units and a JBI descriptor file (jbi.xml under META-INF folder). Each service unit is deployed onto the component which is defined in the service assembly descriptor file. By deploying the service assembly into the container, it will get all the service units and will try to deploy each one on the sepcifed component.
h2. Using a JBI Shared Library
The Petals ESB shared libraries are packaged as ZIP archives which contains the following files :
{noformat}
+ META-INF
- jbi.xml
- lib-A.zip
- lib-N.zip
{noformat}
The shared library contains a collection of Java libraries and a JBI descriptor file (jbi.xml under the META-INF folder). The descriptor file gives the description of the shared library (its name, version) and the list of embedded Java libraries.
A shared library is deployed into the container. Once deployed, this artifact may be potentially used by components to enrich their class loader. This type of artefact is generally used by components which uses the same libraries and so to limitate the resources in the Petals ESB container.
h2. Using the JBI environment
Now that the container is started, the components are installed and the endpoints are activated with the help of the service unit deployment, services can be invoked and messages can be exchanged between service consumers and providers.
!worddav4f9edb3c35a8421a7dd918a233fe66a5.png|height=310,width=358!
In the previous figure, a web service client calls a web service which is hosted by the JBI container. This web service is just a facade. The JBI service which is consumed by the facade can be changed as many time as needed. The only condition is to provide the same interface. This approach is extremely flexible since the JBI service can be a service composition of other JBI services (and recursively to reach atomic JBI services).
h1. Petals ESB JBI Extensions
Petals ESB is not a simple JBI implementation, the current chapter introduces specificities and additionnal features which are not defined in the standard specification.
h2. Distributed Environment
The JBI specification does not deals with any distributed aspect. The main JBI extension and Petals ESB main feature is the distributed approach.
A Petals ESB container can share its services and access services which are hosted by other containers in a transparent way. It means that on the service consumers and providers' point of view there is no additional configuration like in other JBI containers. Where other JBI containers provide a distributed approach by connecting containers with the use of JBI Binding Components plus huge configuration, Petals ESB provide this feature natively without any additional configuration.
!worddava64ad67dbc4e61a01cc5792bcd1eb756.png|height=362,width=534!
The previous figure shows that multiple containers with their deployed JBI artifacts are completelu equal to a single container which holds all these artefacts. The following sections introduce the software modules which are needed to build this Distributed Entreprise Service Bus.
The advantages of this distributed environment are :
* Container and connectors can be deployed close to the real services. This is a way to bypass communication constraints between JBI consumer and JBI provider like firewall issues and other network constraints.
* Complete control of the inter-container communication layer. As described in the previous point, each link between consumer and provider may have a specific configuration. Opening communication ports for JMS, HTTP, FTP, and more is never possible. Opening and securing only communication for one protocol is enough for the Petals ESB inter-communication protocol. A SOAP service client will be able to post a JMS message into a topic without any http or JMS port opening.
h2. Technical Registry
The Petals ESB JBI services, endpoints, interfaces, WSDL descriptions and container location are stored in an embedded technical registry. This registry is used by the Petals ESB containers to register services and to route the JBI messages to the right endpoint.
In order to have a unified vision, the registry entries are replicated among all the Petals ESB nodes using a Distributed HashTable over a multicast channel. This is quite equivalent to data flooding between registries so when an entry is added to the registry, the data is send to all the network registries. All the registries have a complete vision of the services hosted by all the containers.
{note:title=Note}
Since the replicated approach is not scalable at all, the Petals ESB v3.0 will come with a new distributed and extensible registry.
{note}
h2. Inter nodes communication
In order to exchange (send/receive) messages between Petals ESB containers, Petals ESB extends the JBI specification by introducing a message transporter layer.
In a standard JBI implementation, the Normalized Message Router gets the local endpoint reference from the local registry and sends the message to a local JBI endpoint. In the Petals ESB approach, once the endpoint is retrieved from the local registry, the message and the endpoint reference are sent to the transport layer which is in charge to deliver the message to the JBI endpoint whereever the container it is hosted on. This is possible by getting the foreign container information where the JBI services is hosted on from the technical registry. Once all the required information is retrieved, Petals ESB serializes the JBI message to the 'wire format' and send it to the foreign container. The response is sent back from the remote container is needed.
All the containers are linked together by the transporter layer. All the services providers and consumer scan potentially send messages to each other. All the links which were at the charge of the distributed application developer are now hidden by the Petals ESB container not only at the service level but also at the communication one.
!worddave7d2392cb04d3e7021be427e98cb904d.png|height=452,width=603!
The previous figure illustrates two visions of the inter node communication which are totally equivalent. On the left side, all the containers are linked together by point to point communication channels. On the right side, all the containers can also communicate to each other but the links are totally hidden by an abstract communication layer. At the lower level, the links exist but are not important on the transport user point of view (in the Petals ESB case, the router layer does not care about links between containers).
JMS is the historical messaging system Petals uses to exchange messages between hosts (OW2 JORAM JMS implementation http://joram.ow2.org). Since Petals ESB 2.0, a new message transporter has been added. The OW2 DREAM project (http://dream.ow2.org) used for this transporter implemantation is a component-based framework dedicated to the construction of communication middleware. It provides a component library and a set of tools to build, configure and deploy middleware implementing various communication paradigms: group communications, message passing, event-reaction, publish-subscribe, etc... DREAM is alo build upon the FRACTAL component framework, which provides support for hierarchical and dynamic composition.
This communication abstraction is also important on the JBI service consumers and providers side. When standard applications need to create links between service consumers and providers (for example an application which wants to get weather forecast from a Yahoo service and get stock values from the Google service) needs to basically create the links between the client (application under development) and services (Yahoo, Google, and more). Of course, the ideal solution wil be to add an abstraction layer to all of this in case of service provider modification (URL, interface, …). A solution such as an ESB already offers this abstraction layer since the links are the container responsability.
h2. Management
A specification section (chapter 6) is dedicated to the container management using JMX. It mainly deals with the JBI artefacts management such as installation, deployment, starting and stopping. Additionally, the specification defines a set of Apache Ant (http://ant.apache.org) taks to manage the container from Ant scripts.
Petals ESB implements and extends the management requirement of the specification in the way that additional JMX operations have been added to the specification ones. This is possible by extending the Managed Beans (MBeans) and adding new ones.
{note:title=Note}
Must group all the MBeans in a specific package ({{org.ow2.petals.core.kernel.management}}) and list them.
{note}
h2. Monitoring
Petals ESB provides various types of monitoring features :
* Use JMX to store and expose monitoring data. This approach uses the JMX features provided by the container and adds specific monitoring MBeans.
* Use the Fractal Framework. Since quite every JBI artefact (JBI component, JBI endpoint, …) and container module are Fractal components, Petals ESB uses the Fractal potential to provide very advanced monitoring data.
There is actually some work to generalize these monitoring approaches to all the container software components and also to provide monitoring data in more standard ways (using OASIS WSDM specification and WS-* seems to be good candidates). The following figure is a general vision of what is planned by adding aspects/wrappers/controllers to Fractal software components :
!worddavc543395c81a621c1e127037155dcc6d0.png|height=344,width=553!
The main usage if this monitoring data is to display JBI messages and classify them by service, endpoint, interface, container, component, … A tool such as the Petals ESB Monitoring and Management WebConsole uses this monitoring data and provide it in a nice web enabled GUI (of course users can develop their own monitoring client).
!worddavda6e9ae77208978683a58a3293d7916c.png|height=401,width=603!
Another usage of the monitoring data is for load-balancing. Since Petals ESB is a distributed container, the monitoring data can be a good candidate to choose the right JBI endpoint depending on its load. More details are given in the load-balancing section.
h1. Kernel Features
The kernel fully implements the JBI specification. Some features have been introduced in the previous chapters, other ones are defined below.
h2. Domains
Petals ESB is not a simple distributed JBI container where all services can be accessed by all the consumers. To add some visiblity control containers can be classified by domains and subdomains.
!worddav281e19eb5ca3e0f6a8c903db7c9480c9.png|height=360,width=481!
* Petals ESB containers can only communicate with containers which belong to the same domain.
* Services can be declared as public or private so that private services are only accessible from containers which belong to the same subdomain.
This domain and subdomain settings are basically called 'topology' and are defined in the topology.xml file under the Petals ESB distribution configuration folder.
h2. JBI exchange optimisation
JBI message responses, faults or acknowledgements generates extra trafic between consumer and provider because the JBI container must transfer all the message exchange content (the input message, the output one, …) at each pattern step. It is clear that serializing this data and sending it to the wire are time consuming in the distributed environment.
By setting the {{org.ow2.petals.messaging.noack}} property on the message exchange, the acknowledgement and error messages will not be sent through the NMR.
h2. Address Resolver
The Adress Resolver acts as the router level (embedded into a router module) to select the right endpoint to send the message to.
To select the right endpoint, the AR interacts with the Endpoints Registry to get all the endpoints which provide a valid interface and filter the endpoint list by applying a strategy ({{org.ow2.petals.jbi.messaging.routing.strategy.Strategy interface}}).
The strategy is defined at the Message Exchange level ({{org.ow2.petals.routing.strategy}} property) set by the service consumer. Current strategies are :
* *random* : Randomly select an endpoint from the input endpoints list.
* *default* : Select a default strategy from the available ones. No comments in the code…
* *standalone* : Randomly select an endpoint from the input endpoints list.
* *highest* : Select an endpoint based on some weighting given in the message exchange property.
{note:title=Note}
The strategies are defined at the code level and there is no way to add user ones. This code has to be refactored to define strategy in a configuration file in order to give the user the possibility to ad dits own strategies.
{note}
{warning:Warning}
The current javadoc need to be updated to match the current strategies.
{warning}
h2. Router Module
The router module has been decomposed into atomic modules ({{org.ow2.petals.jbi.messaging.routing.module.Module interface}}).
Once the router receives a JBI message from the Delivery Channel or from the Transport layer, it injects this message sequentially in each module for processing.
The standard modules are:
* The *address resolver module* (AR): The AR selects the good endpoint to send the message to.
* The *transport module* : In charge of communication with the transport layer to send/receive messages.
* The *authorization module* : Checks that the message can be send to the selected endpoint. This module uses JAAS for access authorization.
These modules are activated (or not) in the _router.cfg_ configuration file located under the _conf_ folder of the Petals ESB distribution. This part has been designed to be extended by your own module to add some functionnalities at the router level (logging, reporting, …).
h2. Transport layer
The Transport layer, which is in charge of sending/receiving messages to/from the wire, is electing a message transport from the message exchange properties.
Selecting the right message transporter depends on the QoS the service consumer has defined in the {{org.ow2.petals.transport.qos message}} exchange property. Possible values are:
* *fast* : Assures that the message will be sent in the fast way. The message can be lost by the local container if something wrong happens and i twill not be possible to send it again.
* *reliable* : Assures that the message will be persisted in order to be ressent if something wrong happens.
In Petals ESB v2.x, the technologies used to transport messages are OW2-JORAM (open source JMS), OW2-Dream (open source Extensible Messaging Framework, used in TCP/IP mode) and 'InVM' (Memory transport in the same Java Virtual Machine).
h2. Security
h3. Transport level security
Since messages are exchanged between nodes, there is a need of securing the data transmission. This is actually possible by using a SSL channel in the OW2-Dream based message transporter.
h3. Authorization
It is possible to define authorizations at the service operation level.
A router module is in charge of the authorization; it checks that the user (which belongs to a group of users, and which is sending a message to the JBI service) is authorized. This is possible by using the JAAS technology (http://java.sun.com/javase/technologies/security/) in adition to the JBI message exchange security subject.
The default implementation of the JAAS authorization login module is based on a simple configuration file. This router module is configurable and developers can define their own authorization login module based on other users repositories (LDAP for example).
h2. Hot Deployment
The kernel provides a hot deployment features to avoid any Ant script or JMX commands. This hot deployment feature allows to install and start JBI artifacts archives (Component, Service Unit, Service Assembly and Shared Library as ZIP files) by copying them in the distribution install folder. When the kernel detects a new artifact, it install/deploy it and process the lifecycle steps to effectively start the artifact.
The same feature is also available for the uninstallation/undeployment steps. By deleting the artifacts from the uninstall folder, the kernel detects that the artifact must be stopped and undeployed/uninstalled.
Behind the scenes, the kernel calls the JMX management operations needed to process all these steps.
These hot deployment/undeployment features are similar to the web application deployment feature you can find when copying a WAR file into the webapps folder of an Apache Tomcat container.
h2. Data compression
Since JBI messages are XML based and potentially contain redundant data, the compression feature has been added when exchanging messages between Petals ESB containers. This compression is done at transport level when a property ({{org.ow2.petals.transport.compress}}) is detected in the message exchange (set by the service consumer).