An Introduction to Apache ServiceMix 4 - FUSE ESB
-
Upload
adrian-trenaman -
Category
Technology
-
view
11.332 -
download
7
description
Transcript of An Introduction to Apache ServiceMix 4 - FUSE ESB
Progress Education
Apache ServiceMix 4FUSE Community Day
London, 10th June 2010
Adrian TrenamanDistinguished ConsultantFinancial Services Group, Progress Professional Services
http://trenaman.blogspot.com QuickTime™ and a
decompressorare needed to see this picture.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.2
Agenda
A little bit about what ServiceMix 4 really is• Conceptual architecture• Standards and technologies• Deployment and scaling• Experience on the road
How you can be successful with ServiceMix 4• As architects• As developers• As project managers
SOA Fundamentals© 2010 Progress Software Corporation. All rights reserved.3
ServiceMix 4 - architecture, standards & technologies
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.4
Apache ServiceMix 4 - conceptual architecture
JVM-based runtime container for integration and SOA.• EIP-style integration flows
• SOAP web services
• REST web services
• Business processes
• Reliable messaging
• Business Logic
<<jvm>>:ServiceMix4
IntegrationFlows
Web Services
RESTfulServices
BusinessProcesses
Reliable Messaging
Business Logic
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.5
Apache ServiceMix 4 - conceptual architecture (cont’)
ServiceMix provides a uniform approach for common cross-functional concerns• Logging
• Lifecycle and deployment
• Configuration
• Versioning & Dependency Mgmt
• Management
• Security
• Transactions
<<jvm>>:ServiceMix4
IntegrationFlows
Web Services
RESTfulServices
BusinessProcesses
Reliable Messaging
Business Logic
Logging Lifecycle /Deployment Configuration
Versioning Management Security
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.6
Apache ServiceMix 4 - standards and technologies
<<jvm>>:ServiceMix4
IntegrationFlows
Web Services
RESTfulServices
BusinessProcesses
Reliable Messaging
Business Logic
Logging Lifecycle /Deployment Configuration
Versioning Management Security
EIP (Apache Camel) orJBI (ServiceMix 3)
BPEL (Apache ODE)
WSDL, SOAP, XML, XSD, JAX-WS, JSON, (Apache CXF)
Java, JVM-based languages
JMS (Apache ActiveMQ)
OSGi Config Admin
Log4J, Slf4J, commons, Java logging, …
OSGiSSH, JAAS, HTTPS, TLS, …
JMX, web-console, ssh
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.7
Modular deployment with bundles and features
You can deploy almost anything into ServiceMix 4• War, Jar, bundle, spring, …
Prefer OSGi bundles for your routing / integration / business logic• More modular design, explicit
versioning, classpath control.
• Can share classes or objects (OSGi services)
• Dynamic wiring of OSGi services allows live hot deployment of patches without impacting your production deployment.
Use the ‘feature’ mechanism to group and co-deploy bundles.
<<jvm>>:ServiceMix4
a:bundle
b:bundlec:bundle
f1 f2
x:bundle
y:bundle
common
smx:> features:addUrl file:my-features.xml
smx:> features:install f1
my-features.xml
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.8
Getting into production…
Deployment from Maven repository is ideal…• … but remember, admins don’t like running internet-happy developer
tools like Maven in production!• Be prepared to deliver artifacts via .zip or .tar.gz - there are
features-based Maven plugins to help!
MavenDEV
SYSTEST UAT PROD
.tar.gz
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.9
Scaling up, scaling out…
‘to understand ServiceMix, first you must understand ActiveMQ’
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.10
ActiveMQ: networked brokers
Brokers use network connectors to share consumer information and make routing decisions using “store-and-forward”• JMS clients use failover URLs or auto-discovery to connect to a live broker.
c1:Consumerc1:Consumer c2:Consumerc2:Consumer
p:Producerp:Producer<<jvm>>
frodo:ActiveMQ<<jvm>>
frodo:ActiveMQ<<jvm>>
gandalf:ActiveMQ<<jvm>>
gandalf:ActiveMQ
Foo:Foo:Foo:Foo:
mm
1: Producer sends a message m to the broker.
1: Producer sends a message m to the broker.
mm
2: Broker ‘frodo’ decides to route message via broker ‘gandalf’.
2: Broker ‘frodo’ decides to route message via broker ‘gandalf’.
mm 3: message is delivered.3: message is delivered.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.11
Aside: networked brokers allow you to create local broker clusters and implement wide-scale cross-
geography architectures.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.12
ActiveMQ replication, clustering & failover
<<jvm>>samwise:ActiveMQ
<<jvm>>samwise:ActiveMQ
Master state replicated to slave using network connector.
Master state replicated to slave using network connector.
<<jvm>>frodo:ActiveMQ
<<jvm>>frodo:ActiveMQ
<<jvm>>samwise:ActiveMQ
<<jvm>>samwise:ActiveMQ
Brokers compete for file system or database lock.
Brokers compete for file system or database lock.
<<jvm>>frodo:ActiveMQ
<<jvm>>frodo:ActiveMQ
Broker replication Shared message store
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.13
Master
Networks of master-slave pairs
A clustered, highly available approach
<<jvm>>merry:ActiveMQ
<<jvm>>merry:ActiveMQ
<<jvm>>frodo:ActiveMQ
<<jvm>>frodo:ActiveMQ
<<jvm>>gandalf:ActiveMQ
<<jvm>>gandalf:ActiveMQ
<<jvm>>saruman:ActiveMQ
<<jvm>>saruman:ActiveMQ
<<jvm>>samwise:ActiveMQ
<<jvm>>samwise:ActiveMQ
<<jvm>>pip:ActiveMQ
<<jvm>>pip:ActiveMQ
Slave
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.14
… the thing is, it’s largely the same scaling model in ServiceMix
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.15
Master
ServiceMix 4: networks of master-slave pairs
Differs from AMQ only in that slaves can be ‘partially active’
<<jvm>>merry: SMX4
<<jvm>>merry: SMX4
<<jvm>>frodo:SMX4
<<jvm>>frodo:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>saruman: SMX4
<<jvm>>saruman: SMX4
<<jvm>>samwise: SMX4
<<jvm>>samwise: SMX4
<<jvm>>pip: SMX4<<jvm>>
pip: SMX4
Slave
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.16
Master
ServiceMix 4: embedded brokers
Embedded brokers speed up in-VM traffic, and facilitate location transparency via a ‘messaging fabric’
<<jvm>>merry: SMX4
<<jvm>>merry: SMX4
<<jvm>>frodo:SMX4
<<jvm>>frodo:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>saruman: SMX4
<<jvm>>saruman: SMX4
<<jvm>>samwise: SMX4
<<jvm>>samwise: SMX4
<<jvm>>pip: SMX4<<jvm>>
pip: SMX4
Slave
ActiveMQ ActiveMQ ActiveMQ
ActiveMQ ActiveMQ ActiveMQ
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.17
‘The unbearable chattiness of brokers’
or
‘too many brokers spoiled the pot’
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.18
Breaking out the broker
Broker ‘meta-traffic’ will increase as more brokers are added.• Sharing info on what consumers
are listening to what destinations.
If you have many SMX instances, then it might be more sensible to deploy your AMQ infrastructure separately.• This also keeps things
conceptually simple.
• We like simple.Master
<<jvm>>merry: SMX4
<<jvm>>merry: SMX4
<<jvm>>frodo:SMX4
<<jvm>>frodo:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>gandalf:SMX4
<<jvm>>saruman:
SMX4
<<jvm>>saruman:
SMX4
<<jvm>>samwise:
SMX4
<<jvm>>samwise:
SMX4
<<jvm>>pip: SMX4<<jvm>>
pip: SMX4
Slave
<<jvm>>master:AMQ
<<jvm>>master:AMQ
<<jvm>>slave: AMQ<<jvm>>
slave: AMQ
SOA Fundamentals© 2010 Progress Software Corporation. All rights reserved.19
Respecting and supporting our JBI heritage
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.20
JBI - fundamentals
<<jvm>>:SMX
<<jvm>>:SMX
<<component>>:FTP
<<component>>:FTP
NMRNMR
<<component>>:EIP
<<component>>:EIP
<<component>>:SAXON
<<component>>:SAXON
<<component>>:JMS
<<component>>:JMS
ServiceMix acts as a container for “components”, communicating with each other using the XML-based Normalized Message Router.
ServiceMix acts as a container for “components”, communicating with each other using the XML-based Normalized Message Router.
Use well-known components like JMS, HTTP, CXF, Bean, FTP, FILE, or write your own.
Use well-known components like JMS, HTTP, CXF, Bean, FTP, FILE, or write your own.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.21
JBI fundamentals (cont’)
<<jvm>>:SMX
<<component>>:FTP
NMR
<<component>>:EIP
<<component>>:SAXON
<<component>>:JMS
:Transformer
:Pipeline
:Producer
:Poller
Build an application by configuring and wiring endpoints as SUs, combining them into SAs that can be deployed atomically.
Build an application by configuring and wiring endpoints as SUs, combining them into SAs that can be deployed atomically.
Endpoints are configured using xbean (Spring) configuration; deployment artifacts are created using maven plugins.
Endpoints are configured using xbean (Spring) configuration; deployment artifacts are created using maven plugins.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.22
JBI fundamentals: packaging
<<jar>> <<jar>>
<<zip>><<zip>>
.class
xbean.xmljbi.xml
resourcesftp-input-su
<<zip>><<zip>>
.class
xbean.xmljbi.xml
resourceseip-su
<<zip>><<zip>>
.class
xbean.xmljbi.xml
resourcesjms-output-su
<<zip>><<zip>>
.class
xbean.xmljbi.xml
resourcesxslt-transformer-su
Each component is specialized using a SU. Each component is specialized using a SU.
In ServiceMix, the endpoint(s) are defined in an xbean.xml file.
In ServiceMix, the endpoint(s) are defined in an xbean.xml file.
Maven plugins are used to generate jbi.xml fileMaven plugins are used to generate jbi.xml file
SUs can optionally contain support classes and resources such as WSDL & XSD
SUs can optionally contain support classes and resources such as WSDL & XSD
SUs are bundled together into an SA to be deployed atomically.
SUs are bundled together into an SA to be deployed atomically.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.23
<<jvm>>:SMX
<<jvm>>:SMX
NMRNMR
<<jvm>>:SMX
<<jvm>>:SMX
NMRNMR
JBI support in ServiceMix 4
Full support for JBI 1.0
Use JBI without the packaging! • Spring + JBI components.
Use NMR without canonical XML payload
Use Interceptors to monitor endpoints and message exchanges.
New clustering architecture:• Clustered consumers write to
NMR which uses a single JMS queue.
• Providers listen on queue using message selectors
• ActiveMQ network connectors provide location transparency.
:FilePoller:FilePoller
:JMSProvider:JMSProvider
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.24
Where we are today
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.25
What is the community up to?
Better documentation - the ServiceMix book
Building on OSGi Blueprints technology
Supporting Apache Ode
Scalability, performance, feature build-out
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.26
Adopting ServiceMix 4
Java, Maven, Spring - if you don’t have these skills, be prepared to get them.
Invest in technical steering - don’t go in the wrong direction
Nominate FUSE expert(s) on your team - then let them spread the love.
Know yourself - If you 池 e not source-friendly, then get professional help.
In the source, there is truth - don’t be afraid of the truth.
Apache ServiceMix 4 - FUSE Community Days© 2010 Progress Software Corporation. All rights reserved.27
Words from a battle-hardened consultant…
Don’t confuse enterprise integration with workflow or BPM• Use the right tool for the job at hand.
Respect the {n|cr}appy path above the happy path.
Validate performance early, and keep validating it.
Prefer Camel; use JBI as an integration point.
Never forget your customer. Give them visibility and control.• Thing about management early.
Progress Education
Apache ServiceMix 4FUSE Community Day
London, 10th June 2010
Adrian TrenamanDistinguished ConsultantFinancial Services Group, Progress Professional Services
http://trenaman.blogspot.com QuickTime™ and a
decompressorare needed to see this picture.