SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Chicago, October 19 - 22, 2010Chicago, October 19 - 22, 2010
Deploying and Monitoring Spring
Integration and Spring Batch
Applications
Dave Syer - SpringSource
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Agenda
• Spring Batch and Spring Integration
• Spring and JMX
• Spring Integration
– Metrics
– Notifications and alerts
– Control
• Metametrics and Metaoperations: e.g. deployment and provisioning
• Spring Batch
– Control
– Metrics
– Notifications and alerts
• Using SpringSource Hyperic
• More Future Directions
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Batch
Application
Batch Core
Batch Infrastructure
Re-usable low level
stuff: flat files, XML
files, database keys
Quality of service,
auditability,
management
information, Job,
Step, status
Business logic
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Job Configuration
<job>
<step id="load" next="analyse"/>
<step id="analyse">
<next on="COMPLETED" to="summarize"/>
<next on="SKIPS" to="logSkips"/>
<end on="FAILED"/>
</step>
<step id="logSkips" next="summarize"/>
<step id="summarize" />
</job>
<job>
<step id="load" next="analyse"/>
<step id="analyse">
<next on="COMPLETED" to="summarize"/>
<next on="SKIPS" to="logSkips"/>
<end on="FAILED"/>
</step>
<step id="logSkips" next="summarize"/>
<step id="summarize" />
</job>
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Quality of Service
• Stuff happens:
– Item fails
– Job fails
• Failures can be
– Transient – try again and see if you succeed
– Skippable – ignore it and maybe come back to it later
– Fatal – need manual intervention
• Mark a job execution as FAILED
• When it restarts, pick up where you left off
• Monitor status of running and historic executions
• All framework concerns: not business logic
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Batch Domain Diagram
Job
Step
locates
Infrastructure dependencies
executes
JobLauncher
starts and stops
JobParameters
JobExecution
StepExecution
*
JobRepository
stored in
used to identify and manage jobs
executes
Batch
Operator
uses
Application
Developer
configures
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Item-Oriented Processing
• Input-output can be grouped together = Item-Oriented Processing
ItemReader
read()
ExitStatus
ItemWriter
write(item)
Step
item
execute()
repeat,
retry,
etc.
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration
Application
Integration Adapters
Integration Core
Enterprise
Integration Patterns,
message, poller,
router, splitter,
aggregator, etc.
File, JMS, JDBC,
JMX, TCP, etc.
Business logic
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Message
• Payload can be any object
• Header values are stored in a Map
Headers
Payload
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Message Channel
• Decouples Producers from Consumers
• Provides extension point for interceptors
• May be Point-to-Point
• Or Publish/Subscribe
Producer
Consumer
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Low-level Components
Message
Source
Message
Handler
Endpoint
• Passive
• Poller
• Lifecycle
Message
Channel
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
The Big Picture
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Batch and Spring Integration
• Message triggers Job
• Step wraps gateway (e.g. background processing)
• Remote chunking
• Partitioning
• Automatic retry
• Flat file and XML processing
• QoS: once only processing, restart
• Audit: track status of execution
• http://www.springsource.org/spring-batch-admin/spring-
batch-integration
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
JMX
Application
Client
MBeanServer
MBean MBean MBean
Connector Connector
Client
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
JMX
• MBeanServer provides services to MBeans and clients
(through connectors)
– Registration (ObjectName -> MBean)
– Attributes
– Operations
– Notifications
– Monitors (thresholds, value changes etc.)
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring and JMX
@ManagedResource
public class TransferServiceImpl implements TransferService {
@ManagedOperation
public void transfer(String source, String target, double amount) {
…
}
@ManagedAttribute
public double getTotalBalance() {
…
}
}
@ManagedResource
public class TransferServiceImpl implements TransferService {
@ManagedOperation
public void transfer(String source, String target, double amount) {
…
}
@ManagedAttribute
public double getTotalBalance() {
…
}
}
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring and JMX
<context:mbean-server id="mbeanServer" />
<context:mbean-export server="mbeanServer" />
<bean id="transferService" class="com.foo.TransferServiceImpl"/>
<context:mbean-server id="mbeanServer" />
<context:mbean-export server="mbeanServer" />
<bean id="transferService" class="com.foo.TransferServiceImpl"/>
MBean
com.foo:type=TransferServiceImpl,name=transferService
ObjectName
Automatically unregistered when
ApplicationContext closes
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring 3.0 and JMX: Hyperic Metrics
@ManagedResource
public class TransferServiceImpl implements TransferService {
…
@ManagedMetric(metricType = MetricType.GAUGE)
public double getTotalBalance() {
…
}
}
<context:mbean-export server="mbeanServer" default-
domain="spring.application"/>
@ManagedResource
public class TransferServiceImpl implements TransferService {
…
@ManagedMetric(metricType = MetricType.GAUGE)
public double getTotalBalance() {
…
}
}
<context:mbean-export server="mbeanServer" default-
domain="spring.application"/>
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration Metric Use Cases
• How many messages have been processed?
• How long did it take?
• Are things getting any worse?
• Were there any errors?
• Can I shutdown the system now without losing any
messages?
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration Metrics
• MessageChannel
– send count, receive count (if polling)
– execution times
– error rates and ratios
• MessageHandler
– handle count
– execution times
– error rates
• MessageSource
– message count
• Global
– active handler count
– queued message count
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
MessageHandler: Naming Problems
• MessageHandler is end user API (usually POJO) and
location of interesting metrics
• Endpoint is the thing with a name (bean id)
• Many endpoints are anonymous
• But channels are not
widgets
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration JMX
<int-jmx:mbean-export server="mbeanServer“
default-domain="spring.application"/>
<int:channel id="widgets"/>
<int:service-activator input-channel="widgets"
expression="payload.length()" />
<int-jmx:mbean-export server="mbeanServer“
default-domain="spring.application"/>
<int:channel id="widgets"/>
<int:service-activator input-channel="widgets"
expression="payload.length()" />
MBean
spring.application:type=MessageChannel,name=widgets
MBean
spring.application:type=MessageHandler,name=widgets,bean=anonymous
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration Metric Types
ExponentialMovingAverageHandleDurationMessageHandler
IntegerHandleCountMessageHandler
ExponentialMovingAverageRatioErrorRatioMessageChannel
ExponentialMovingAverageRateSendErrorRateMessageChannel
ExponentialMovingAverageSendDurationMessageChannel
IntegerQueueSizeMessageChannel
IntegerSendCountMessageChannel
AlgorithmMetricComponent
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration Control
• Alerts on hotspots: slow handling, high error rates
• Lifecycle
– start, stop, running
• Throttle messages on downstream error
• Graceful shutdown
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Metametrics and Metaoperations
• Deployment and provisioning: get me one instance of this
application.
• What have I got deployed?
• Is it working?
• Scale and elastic scale: increase the number of workers.
• Dynamic load: re-balance thread pools.
• Highlight 4 approaches
– Command line
– Local service
– Build and deployment tool
– Private or public cloud
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Command Line
• Write a Java main() method
• Use one off the shelf, e.g. CommandLineJobRunner
• Maybe use Maven, Ant, Gradle etc.
• Pros:
• Lowest common denominator
• High granularity:
– Tweak JVM parameters (heap size etc.)
– Tweak global transaction settings
• Cons:
• Setting up classpath and dependencies
• Inventory: tracing and managing versions
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Local Service: Servlet Container
• Write a servlet / web service for the business features
• Use one off the shelf, e.g. Spring Batch Admin
• Pros:
• Readily available container
• Standard packaging and dependency management
• Tools for monitoring and management, e.g. Hyperic
• Cons:
• Some overhead creating container instance
• Low granularity: module boundaries have to be drawn
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Remote Build and Deployment Tool
• Write a remote build and deployment tool
• Use one off the shelf, e.g. Capistrano, Hudson
• Pros:
• Granularity of command line
• Can be used to manage remote server as well
• Handles versioning
• Cons:
• New technology for some users
• Still quite low level: requires script maintainence
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Private or Public Cloud (PaaS)
• Make deployment and provisioning a service
• Pros:
• Commoditisation / standardisation
• Public services easily accessible
• Private cloud products emerging (e.g. Napa)
• Very efficient once running: “blueprint” applies to all
deployments
• Elastic and dynamic scale are built in features
• Cons:
• Extra layer in process and implementation
• Some restrictions on application, especially in public
clouds
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Batch Control
• Basic use cases
– Stop a job execution
– Abort a job execution
– Restart a job execution*
– Start new or next execution*
• Exposed through Spring Batch Admin and
CommandLineJobRunner
• SBA can be deployed as a standalone service (just needs
a JobRepository)
• *WithSBA only for Jobs that are configured inside SBA
application
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Batch Metrics
• Latest JobExecution status, duration
• StepExecution status and history, items processed,
skipped, failure analysis
• Implementation: Spring Batch Admin
– web application
– services (REST and Java)
– JMX endpoints, e.g. consume with Hyperic
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Notifications and Alerts
• Spring Batch SLA: step overrun
– When a step execution takes too long, downstream
processing can fail
– Use MBean Monitor features to send notifications
– JMX client can enable and consume the notifications as
desired
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Step Execution SLA
<bean id="serviceLevel"
class="org...admin.jmx.StepExecutionServiceLevelMonitor">
<constructor-arg ref="batchMBeanExporter"/>
<property name="timeout" value=“60000" />
<property name="jobName" value="job1" />
<property name="stepName" value="j1.s1" />
<property name="enabled" value="true" />
</bean>
<bean id="serviceLevel"
class="org...admin.jmx.StepExecutionServiceLevelMonitor">
<constructor-arg ref="batchMBeanExporter"/>
<property name="timeout" value=“60000" />
<property name="jobName" value="job1" />
<property name="stepName" value="j1.s1" />
<property name="enabled" value="true" />
</bean>
MBean
spring.application:type=StepExecutionMonitor/WARN,name=job1/j1.s1
spring.application:type=StepExecutionMonitor/ERROR,name=job1/j1.s1
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
JMX Notifications and Spring Integration
• Spring Integration provides adapters for JMX notifications:
– inbound: notification -> Message
– outbound: Message -> notification
<jmx:notification-listening-channel-adapter
channel="input"
object-name="com.foo:type=TestBean,name=testBean"/>
<jmx:notification-publishing-channel-adapter
channel="input"
object-name="com.foo:type=TestBean,name=testBean“
default-notification-type="com.foo.test"/>
<jmx:notification-listening-channel-adapter
channel="input"
object-name="com.foo:type=TestBean,name=testBean"/>
<jmx:notification-publishing-channel-adapter
channel="input"
object-name="com.foo:type=TestBean,name=testBean“
default-notification-type="com.foo.test"/>
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Spring Integration ControlBus
• MBean operations on Message* components triggered by
Message
<jmx:control-bus mbean-exporter="mbeanExporter"
channel="control"/>
<int-jmx:mbean-export server="mbeanServer"/>
<jmx:control-bus mbean-exporter="mbeanExporter"
channel="control"/>
<int-jmx:mbean-export server="mbeanServer"/>
control
ControlBus.TARGET_BEAN_NAME=“myEndpoint"
JmxHeaders.OPERATION_NAME="stop"
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
JMX Notifications and Hyperic
• Hyperic can also consume JMX notifications
– treated like log files (regex pattern on message)
– generate alerts (email, SMS etc.)
– trigger control actions (e.g. switch off upstream messages)
• Some bugfixes not yet released support auto-detection
with no XML (should be in 4.5.x)
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Demo?
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
More Future Directions
• Tracing and Business Transaction Monitoring
• Replay failed transaction
• Automated scheduling and restart
• Performance summary, test harness
SpringOne 2GX 2010. All rights reserved. Do not distribute without permission.
Q&A
Source Code for demos:
http://git.springsource.org/s2gx-2010/monitoring-spring-batch-integration

Weitere ähnliche Inhalte

Was ist angesagt?

Mule enterprise service bus
Mule enterprise service busMule enterprise service bus
Mule enterprise service busThang Loi
 
Muletransformers
MuletransformersMuletransformers
Muletransformersvijaynerd
 
Integration Patterns With Spring integration
Integration Patterns With Spring integrationIntegration Patterns With Spring integration
Integration Patterns With Spring integrationEldad Dor
 
Mule web services
Mule web servicesMule web services
Mule web servicesThang Loi
 
Jms deep dive [con4864]
Jms deep dive [con4864]Jms deep dive [con4864]
Jms deep dive [con4864]Ryan Cuprak
 
weblogic perfomence tuning
weblogic perfomence tuningweblogic perfomence tuning
weblogic perfomence tuningprathap kumar
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsJames Bayer
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring IntegrationVadim Mikhnevych
 
Datasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafDatasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafMidVision
 
Power of Transformation with DataWeave 2.X Engine
Power of Transformation with DataWeave 2.X EnginePower of Transformation with DataWeave 2.X Engine
Power of Transformation with DataWeave 2.X EngineManish Kumar Yadav
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom Joshua Long
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformerskunal vishe
 
Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!hegdekiranr
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchangesSon Nguyen
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in muleSindhu VL
 
Shorten All URLs
Shorten All URLsShorten All URLs
Shorten All URLsJakarta_EE
 

Was ist angesagt? (20)

Apache ActiveMQ
Apache ActiveMQ Apache ActiveMQ
Apache ActiveMQ
 
Mule enterprise service bus
Mule enterprise service busMule enterprise service bus
Mule enterprise service bus
 
Muletransformers
MuletransformersMuletransformers
Muletransformers
 
Integration Patterns With Spring integration
Integration Patterns With Spring integrationIntegration Patterns With Spring integration
Integration Patterns With Spring integration
 
Mule web services
Mule web servicesMule web services
Mule web services
 
Jms deep dive [con4864]
Jms deep dive [con4864]Jms deep dive [con4864]
Jms deep dive [con4864]
 
weblogic perfomence tuning
weblogic perfomence tuningweblogic perfomence tuning
weblogic perfomence tuning
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
 
Rabbit mq in mule
Rabbit mq in muleRabbit mq in mule
Rabbit mq in mule
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring Integration
 
Datasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafDatasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmraf
 
Power of Transformation with DataWeave 2.X Engine
Power of Transformation with DataWeave 2.X EnginePower of Transformation with DataWeave 2.X Engine
Power of Transformation with DataWeave 2.X Engine
 
IBM MQ vs Apache ActiveMQ
IBM MQ vs Apache ActiveMQIBM MQ vs Apache ActiveMQ
IBM MQ vs Apache ActiveMQ
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
 
Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchanges
 
Connectors in mule
Connectors in muleConnectors in mule
Connectors in mule
 
Shorten All URLs
Shorten All URLsShorten All URLs
Shorten All URLs
 

Ähnlich wie Syer Monitoring Integration And Batch

High Volume Payments using Mule
High Volume Payments using MuleHigh Volume Payments using Mule
High Volume Payments using MuleAdhish Pendharkar
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go BadSteve Loughran
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatVMware Hyperic
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkbanq jdon
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Servicesmattjive
 
Introduction to Apache Apex
Introduction to Apache ApexIntroduction to Apache Apex
Introduction to Apache ApexApache Apex
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Stream Processing with Apache Apex
Stream Processing with Apache ApexStream Processing with Apache Apex
Stream Processing with Apache ApexPramod Immaneni
 
Step by-step-lsmw-tutorial-101208040548-phpapp02
Step by-step-lsmw-tutorial-101208040548-phpapp02Step by-step-lsmw-tutorial-101208040548-phpapp02
Step by-step-lsmw-tutorial-101208040548-phpapp02johnbryan26
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.Renzo Tomà
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessLalit Kale
 
Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyftmarkgrover
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEORNodeXperts
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained Markus Eisele
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelJosé Román Martín Gil
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?João Pedro Martins
 
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)Codit
 

Ähnlich wie Syer Monitoring Integration And Batch (20)

High Volume Payments using Mule
High Volume Payments using MuleHigh Volume Payments using Mule
High Volume Payments using Mule
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go Bad
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
Introduction to Apache Apex
Introduction to Apache ApexIntroduction to Apache Apex
Introduction to Apache Apex
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Why meteor
Why meteorWhy meteor
Why meteor
 
Stream Processing with Apache Apex
Stream Processing with Apache ApexStream Processing with Apache Apex
Stream Processing with Apache Apex
 
Step by-step-lsmw-tutorial-101208040548-phpapp02
Step by-step-lsmw-tutorial-101208040548-phpapp02Step by-step-lsmw-tutorial-101208040548-phpapp02
Step by-step-lsmw-tutorial-101208040548-phpapp02
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyft
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEOR
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache CamelOpenSouthCode 2018 - Integrating your applications easily with Apache Camel
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
 
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)
Azure Service Fabric: notes from the field (Sam Vanhoute @Integrate 2016)
 

Kürzlich hochgeladen

The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 

Kürzlich hochgeladen (20)

The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 

Syer Monitoring Integration And Batch

  • 1. Chicago, October 19 - 22, 2010Chicago, October 19 - 22, 2010 Deploying and Monitoring Spring Integration and Spring Batch Applications Dave Syer - SpringSource
  • 2. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Agenda • Spring Batch and Spring Integration • Spring and JMX • Spring Integration – Metrics – Notifications and alerts – Control • Metametrics and Metaoperations: e.g. deployment and provisioning • Spring Batch – Control – Metrics – Notifications and alerts • Using SpringSource Hyperic • More Future Directions
  • 3. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Batch Application Batch Core Batch Infrastructure Re-usable low level stuff: flat files, XML files, database keys Quality of service, auditability, management information, Job, Step, status Business logic
  • 4. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Job Configuration <job> <step id="load" next="analyse"/> <step id="analyse"> <next on="COMPLETED" to="summarize"/> <next on="SKIPS" to="logSkips"/> <end on="FAILED"/> </step> <step id="logSkips" next="summarize"/> <step id="summarize" /> </job> <job> <step id="load" next="analyse"/> <step id="analyse"> <next on="COMPLETED" to="summarize"/> <next on="SKIPS" to="logSkips"/> <end on="FAILED"/> </step> <step id="logSkips" next="summarize"/> <step id="summarize" /> </job>
  • 5. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Quality of Service • Stuff happens: – Item fails – Job fails • Failures can be – Transient – try again and see if you succeed – Skippable – ignore it and maybe come back to it later – Fatal – need manual intervention • Mark a job execution as FAILED • When it restarts, pick up where you left off • Monitor status of running and historic executions • All framework concerns: not business logic
  • 6. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Batch Domain Diagram Job Step locates Infrastructure dependencies executes JobLauncher starts and stops JobParameters JobExecution StepExecution * JobRepository stored in used to identify and manage jobs executes Batch Operator uses Application Developer configures
  • 7. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Item-Oriented Processing • Input-output can be grouped together = Item-Oriented Processing ItemReader read() ExitStatus ItemWriter write(item) Step item execute() repeat, retry, etc.
  • 8. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo
  • 9. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration Application Integration Adapters Integration Core Enterprise Integration Patterns, message, poller, router, splitter, aggregator, etc. File, JMS, JDBC, JMX, TCP, etc. Business logic
  • 10. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Message • Payload can be any object • Header values are stored in a Map Headers Payload
  • 11. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Message Channel • Decouples Producers from Consumers • Provides extension point for interceptors • May be Point-to-Point • Or Publish/Subscribe Producer Consumer
  • 12. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Low-level Components Message Source Message Handler Endpoint • Passive • Poller • Lifecycle Message Channel
  • 13. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. The Big Picture
  • 14. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo
  • 15. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Batch and Spring Integration • Message triggers Job • Step wraps gateway (e.g. background processing) • Remote chunking • Partitioning • Automatic retry • Flat file and XML processing • QoS: once only processing, restart • Audit: track status of execution • http://www.springsource.org/spring-batch-admin/spring- batch-integration
  • 16. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. JMX Application Client MBeanServer MBean MBean MBean Connector Connector Client
  • 17. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. JMX • MBeanServer provides services to MBeans and clients (through connectors) – Registration (ObjectName -> MBean) – Attributes – Operations – Notifications – Monitors (thresholds, value changes etc.)
  • 18. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring and JMX @ManagedResource public class TransferServiceImpl implements TransferService { @ManagedOperation public void transfer(String source, String target, double amount) { … } @ManagedAttribute public double getTotalBalance() { … } } @ManagedResource public class TransferServiceImpl implements TransferService { @ManagedOperation public void transfer(String source, String target, double amount) { … } @ManagedAttribute public double getTotalBalance() { … } }
  • 19. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring and JMX <context:mbean-server id="mbeanServer" /> <context:mbean-export server="mbeanServer" /> <bean id="transferService" class="com.foo.TransferServiceImpl"/> <context:mbean-server id="mbeanServer" /> <context:mbean-export server="mbeanServer" /> <bean id="transferService" class="com.foo.TransferServiceImpl"/> MBean com.foo:type=TransferServiceImpl,name=transferService ObjectName Automatically unregistered when ApplicationContext closes
  • 20. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring 3.0 and JMX: Hyperic Metrics @ManagedResource public class TransferServiceImpl implements TransferService { … @ManagedMetric(metricType = MetricType.GAUGE) public double getTotalBalance() { … } } <context:mbean-export server="mbeanServer" default- domain="spring.application"/> @ManagedResource public class TransferServiceImpl implements TransferService { … @ManagedMetric(metricType = MetricType.GAUGE) public double getTotalBalance() { … } } <context:mbean-export server="mbeanServer" default- domain="spring.application"/>
  • 21. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration Metric Use Cases • How many messages have been processed? • How long did it take? • Are things getting any worse? • Were there any errors? • Can I shutdown the system now without losing any messages?
  • 22. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration Metrics • MessageChannel – send count, receive count (if polling) – execution times – error rates and ratios • MessageHandler – handle count – execution times – error rates • MessageSource – message count • Global – active handler count – queued message count
  • 23. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. MessageHandler: Naming Problems • MessageHandler is end user API (usually POJO) and location of interesting metrics • Endpoint is the thing with a name (bean id) • Many endpoints are anonymous • But channels are not widgets
  • 24. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration JMX <int-jmx:mbean-export server="mbeanServer“ default-domain="spring.application"/> <int:channel id="widgets"/> <int:service-activator input-channel="widgets" expression="payload.length()" /> <int-jmx:mbean-export server="mbeanServer“ default-domain="spring.application"/> <int:channel id="widgets"/> <int:service-activator input-channel="widgets" expression="payload.length()" /> MBean spring.application:type=MessageChannel,name=widgets MBean spring.application:type=MessageHandler,name=widgets,bean=anonymous
  • 25. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo
  • 26. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration Metric Types ExponentialMovingAverageHandleDurationMessageHandler IntegerHandleCountMessageHandler ExponentialMovingAverageRatioErrorRatioMessageChannel ExponentialMovingAverageRateSendErrorRateMessageChannel ExponentialMovingAverageSendDurationMessageChannel IntegerQueueSizeMessageChannel IntegerSendCountMessageChannel AlgorithmMetricComponent
  • 27. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration Control • Alerts on hotspots: slow handling, high error rates • Lifecycle – start, stop, running • Throttle messages on downstream error • Graceful shutdown
  • 28. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo
  • 29. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Metametrics and Metaoperations • Deployment and provisioning: get me one instance of this application. • What have I got deployed? • Is it working? • Scale and elastic scale: increase the number of workers. • Dynamic load: re-balance thread pools. • Highlight 4 approaches – Command line – Local service – Build and deployment tool – Private or public cloud
  • 30. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Command Line • Write a Java main() method • Use one off the shelf, e.g. CommandLineJobRunner • Maybe use Maven, Ant, Gradle etc. • Pros: • Lowest common denominator • High granularity: – Tweak JVM parameters (heap size etc.) – Tweak global transaction settings • Cons: • Setting up classpath and dependencies • Inventory: tracing and managing versions
  • 31. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Local Service: Servlet Container • Write a servlet / web service for the business features • Use one off the shelf, e.g. Spring Batch Admin • Pros: • Readily available container • Standard packaging and dependency management • Tools for monitoring and management, e.g. Hyperic • Cons: • Some overhead creating container instance • Low granularity: module boundaries have to be drawn
  • 32. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Remote Build and Deployment Tool • Write a remote build and deployment tool • Use one off the shelf, e.g. Capistrano, Hudson • Pros: • Granularity of command line • Can be used to manage remote server as well • Handles versioning • Cons: • New technology for some users • Still quite low level: requires script maintainence
  • 33. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Private or Public Cloud (PaaS) • Make deployment and provisioning a service • Pros: • Commoditisation / standardisation • Public services easily accessible • Private cloud products emerging (e.g. Napa) • Very efficient once running: “blueprint” applies to all deployments • Elastic and dynamic scale are built in features • Cons: • Extra layer in process and implementation • Some restrictions on application, especially in public clouds
  • 34. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Batch Control • Basic use cases – Stop a job execution – Abort a job execution – Restart a job execution* – Start new or next execution* • Exposed through Spring Batch Admin and CommandLineJobRunner • SBA can be deployed as a standalone service (just needs a JobRepository) • *WithSBA only for Jobs that are configured inside SBA application
  • 35. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Batch Metrics • Latest JobExecution status, duration • StepExecution status and history, items processed, skipped, failure analysis • Implementation: Spring Batch Admin – web application – services (REST and Java) – JMX endpoints, e.g. consume with Hyperic
  • 36. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Notifications and Alerts • Spring Batch SLA: step overrun – When a step execution takes too long, downstream processing can fail – Use MBean Monitor features to send notifications – JMX client can enable and consume the notifications as desired
  • 37. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Step Execution SLA <bean id="serviceLevel" class="org...admin.jmx.StepExecutionServiceLevelMonitor"> <constructor-arg ref="batchMBeanExporter"/> <property name="timeout" value=“60000" /> <property name="jobName" value="job1" /> <property name="stepName" value="j1.s1" /> <property name="enabled" value="true" /> </bean> <bean id="serviceLevel" class="org...admin.jmx.StepExecutionServiceLevelMonitor"> <constructor-arg ref="batchMBeanExporter"/> <property name="timeout" value=“60000" /> <property name="jobName" value="job1" /> <property name="stepName" value="j1.s1" /> <property name="enabled" value="true" /> </bean> MBean spring.application:type=StepExecutionMonitor/WARN,name=job1/j1.s1 spring.application:type=StepExecutionMonitor/ERROR,name=job1/j1.s1
  • 38. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo
  • 39. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. JMX Notifications and Spring Integration • Spring Integration provides adapters for JMX notifications: – inbound: notification -> Message – outbound: Message -> notification <jmx:notification-listening-channel-adapter channel="input" object-name="com.foo:type=TestBean,name=testBean"/> <jmx:notification-publishing-channel-adapter channel="input" object-name="com.foo:type=TestBean,name=testBean“ default-notification-type="com.foo.test"/> <jmx:notification-listening-channel-adapter channel="input" object-name="com.foo:type=TestBean,name=testBean"/> <jmx:notification-publishing-channel-adapter channel="input" object-name="com.foo:type=TestBean,name=testBean“ default-notification-type="com.foo.test"/>
  • 40. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Spring Integration ControlBus • MBean operations on Message* components triggered by Message <jmx:control-bus mbean-exporter="mbeanExporter" channel="control"/> <int-jmx:mbean-export server="mbeanServer"/> <jmx:control-bus mbean-exporter="mbeanExporter" channel="control"/> <int-jmx:mbean-export server="mbeanServer"/> control ControlBus.TARGET_BEAN_NAME=“myEndpoint" JmxHeaders.OPERATION_NAME="stop"
  • 41. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. JMX Notifications and Hyperic • Hyperic can also consume JMX notifications – treated like log files (regex pattern on message) – generate alerts (email, SMS etc.) – trigger control actions (e.g. switch off upstream messages) • Some bugfixes not yet released support auto-detection with no XML (should be in 4.5.x)
  • 42. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Demo?
  • 43. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. More Future Directions • Tracing and Business Transaction Monitoring • Replay failed transaction • Automated scheduling and restart • Performance summary, test harness
  • 44. SpringOne 2GX 2010. All rights reserved. Do not distribute without permission. Q&A Source Code for demos: http://git.springsource.org/s2gx-2010/monitoring-spring-batch-integration