850 likes | 944 Vues
Gain insights into the role of ESB in modern enterprise architectures and the importance of Web services, SOAP, and messaging protocols for seamless integration. Learn about SOA principles and the relevance of WSDL in service-oriented design.
E N D
An Overview of JBI • May 2007
About Me • Application Architect with Daugherty Business Solutions • Working on a Fraud Detection Platform • NOT doing integrations right now :-( • Implemented several of Hohpe’s patterns in JMS
Part 0 - The “level-set” • We all know Java, except Stacey • We’ve played with Web services and WSDL • We know <sarcasm> and love </sarcasm> XML • May have used JMS or another messaging provider, IBM MQSeries, MSMQ etc.
A motivating example... • Consider the traditional client/server application...
Client/Server Problems • Tight coupling • Protocol independence? (TCP/IP connection-oriented protocol) • No platform independence - 32 or 64 bit, PC to Mainframe, etc. • No recovery • No failover
Enterprise “Opportunities” • Data is transported between apps • Data needs to be understood by both apps • Require a communication channel to move the information • Two endpoints must be available • Information is transported as a message
Service-Oriented Architecture (SOA) • A design approach (paradigm) that encapsulates application logic in a set of services that interact using a common communications protocol. • Communications protocols can be XML-based Web services, JMS, CORBA etc.
Enterprise Service Bus(ESB) • Data grid capable of spanning the Enterprise globally • Standards-based integration • Integrates with anything that supports SOAP and Web services • Highly distributed, deployed services
ESB continued... • Distributed Data transformation • Remote configuration and management • Uses XML as the lingua franca of communication • Real-time Business data
Web Service • Based on open standards • Discoverable, distributed Service • XML based interaction • Platform agnostic • Vendor neutral
Web Service Roles • Services can assume different roles when involved in different integration scenarios: • Service provider • Service requestor • Intermediary • Initial sender • Ultimate receiver
WSDL (whiz-dul) • WSDL 1.1 originally submitted by Ariba, IBM and Microsoft • XML document describing a Web service • Binding section “operation” attribute is the exposed service • Each operation requires a SOAP action to be defined
Document Structure <definitions> <types> </types> <message> </message> <portType> </portType> <binding> </binding> </definitions>
Document Sample <definitions name=”OrderingService”> <message name=”placeOrderRequest”> <part name=”custName” type=”string”/> <part name=”prodNum” type=”string”/> </message> <message name=”placeOrderRequest”> <part name=”custName” type=”string”/> <part name=”prodNum” type=”string”/> </message> <portType name=”OrderingPort”> <operation name=”placeOrder”> <input message=”placeOrderRequest”/> <output message=”placeOrderResponse”/> </operation> </portType> <binding type=”OrderingPort” name=”OrderingBinding”> <soap: binding style=”rpc” transport=”http”/> <operation name=”placeOrder”/> </binding> <service name=”SalesOrderService”> <port binding=”OrderingBinding”> <soap:address location=”http://...”/> </port> </service> </definitions>
SOAP (not the cleaner) • A W3C Spec, originally submitted by Microsoft • A protocol for exchanging XML-based messages and accessing Webservices • Allows for RPC and Document styles of communication • SOAP message consists of Envelope and Body
Sample SOAP Request <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetails xmlns="http://warehouse.example.com/ws"> <productID>827635</productID> </getProductDetails> </soap:Body> </soap:Envelope> Source: http://en.wikipedia.org/wiki/SOAP
Sample SOAP Response <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetailsResponse xmlns="http://warehouse.example.com/ws"> <getProductDetailsResult> <productName>Toptimate 3-Piece Set</productName> <productID>827635</productID> <description>3-Piece luggage set. Black Polyester.</description> <price currency="NIS">96.50</price> <inStock>true</inStock> </getProductDetailsResult> </getProductDetailsResponse> </soap:Body> </soap:Envelope> Source: http://en.wikipedia.org/wiki/SOAP
Messaging • Some form of data exchange between a provider/sender and a consumer/receiver of information through an Enterprise channel
Message...Hohpe’s • A data record that the messaging system can transmit through a “Message Channel” • Consists of header information used by the messaging system that describes the data being transmitted, its origin, its destination etc. (Note: Message Routing semantics)
Message...Buschmann/Henney/Schmidt • Message queuing systems, such as IBM MQSeries or Microsoft MSMQ messages, define a user-defined body with which higher layers can implicitly transmit user data. (Infers Message Routing intelligence)
Message...Krafzig/Banke/Slama • Consists of header and a payload. The structure of the header file is usually predefined by the system and contains network routing information
So, how does JBI define a Message? • Called a Normalized Message • Consists of 3 parts: • a payload - XML document that conforms to WSDL message type • message properties/metadata (a.k.a routing information) • message attachments
What do they all agree on? • A message contains a data payload and supplemental information that allows it to be intelligently routed through some sort of message delivery channel
Basic Integration • Sending messages through a channel that may, or may not, provide transformations and/or business logic between endpoints.
Integration Components • Application(s) • Channel • Message • Endpoints • Message Router
Applications • Can be either a provider or consumer of a particular service • Acts as an Endpoint, stay tuned...more on this in a few minutes
Channel • Logical address, not physical • Agreed upon by both consumer and producer • A good example: http://www.foo.com • JMS: Topic or Queue
Message • A representation of “some” data • The payload that either consumer or producer care about • E.g. Raw bytes, formatted text (XML) etc. • Metadata describing routing information through ESB
Endpoints • Initiator or receiver of information • one end of the entire integration • Or can be a router of information to other consumers • JMS: Topics have subscribers
Message Router • Logcially routes messages based on payload, content or other metadata • Example Patterns: Message Broker, Message Dispatcher, Splitter, Filter
Message Transformations • When sender and receiver do not agree on the format • Converts a message from one format to another • Hohpe’s patterns: Message Translator, Content Enricher, Normalizer etc.
JBI - The What? • JSR 208, Standard Specification • Infrastructure and Component framework for integrations • JBI Components plug into the JBI Framework
JBI - What? part deux • Divided into Service Engine Components and Binding Components • Components communicate through mediated Message Exchanges
Service Engine (SE)Components • Plug-in components provide business logic, transformational services etc. • Some SE's can contain other SE's, “container of containers” • ServiceMix provides SE's for JMS, EJB, Drools, HTTP and many many more
Binding (BC) Components • Provide connectivity to components external to the JBI environment • Send and receive messages for some particular protocol and transports • Provide a sort of adapter for messages and the transport and protocol
JBI Management • Management Structure based on JMX • Standardizes: • Installation • Managing component lifecycle • Deploying services to components • Components can act as a container for other components
JBI Roles • Similar to JEE, based on roles for development and deployment • Integration Architect – designs the overall approach to solving integration problems • Integration Technologist – identifies particular services needed for solving integration problems
Roles continued... • System Administrator – installs, configures and monitors the JBI environment • JBI Component Developer – provides Java components that conform to the JBI-spec contracts
JBI Architecture • WSDL-based Messaging Model • Declarative (XML) service model • Supports plug-in components • Management configuration through JMX
WSDL Messaging Model • Produces or Consumes services using WSDL 1.1 or WSDL 2.0 specifications • Abstract Model • Concrete Model
Abstract Model • Message Types defined in XML schema • Operations defined with a name and a Message Exchange Pattern (MEP) and a type • Interfaces - collections of related operations (not the same as a Java interface) • Communication protocol neutral
Concrete Model • Build upon the Abstract Service Model • Maps abstract definition to communication protocol and communication endpoint • Binding type - communication protocol • Endpoints - designates endpoint information • Service - name, type and endpoint of service
Normalized Message Router (NMR) • Receives Message Exchanges from JBI components • Routes to appropriate handling component • Decouples Producers from Consumers enabling different processing
Normalized Message • Defined earlier • JBI’s “version” of a plain Message • Consists of 3 parts: • Message metadata for routing • Payload • Arbitrary attachments