SlideShare a Scribd company logo
How to use Batch component
28-05-2015
Abstract
• The main motto of this PPT is How to use
Batch component in our applications.
Introduction
• Mule possesses the ability to process messages
in batches. Within an application, you can initiate
a batch job which is a block of code that splits
messages into individual records, performs
actions upon each record, then reports on the
results and potentially pushes the processed
output to other systems or queues. This
functionality is particularly useful when working
with streaming input or when engineering "near
real-time" data integration between SaaS
applications.
Example
.mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:db="http://www.mulesoft.org/schema/mule/db"
xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
• xmlns:spring="http://www.springframework.org/schema/beans"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
• http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
• http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
• http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
• <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8089" doc:name="HTTP Listener Configuration"/>
• <db:generic-config name="Generic_Database_Configuration" url="jdbc:sqlserver://localhost:1433;databaseName=SOA_VMES_DB;user=****;password=****;"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/>
• <batch:job name="SampleBatch" max-failed-records="-1">
• <batch:process-records>
• <batch:step name="Batch_Step">
• <logger message="--Batch step--#[payload]--" level="INFO" doc:name="Logger"/>
• <foreach doc:name="For Each">
• <logger message="--for each--batch step--#[payload]" level="INFO" doc:name="Logger"/>
• <choice doc:name="Choice">
• <when expression="#[payload==5]">
• <db:update config-ref="Generic_Database_Configuration" doc:name="Database">
• <db:parameterized-query><![CDATA[update mytable22 set status='successsuccesssuccesssuccesssuccesssuccess' where num=#[payload]]]></db:parameterized-query>
• </db:update>
• </when>
• <otherwise>
• <db:update config-ref="Generic_Database_Configuration" doc:name="Database">
• <db:parameterized-query><![CDATA[update mytable22 set status='Success' where num=#[payload]]]></db:parameterized-query>
• </db:update>
• </otherwise>
• </choice>
• </foreach>
• </batch:step>
• <batch:step name="Batch_Step1" accept-policy="ONLY_FAILURES">
• <logger message="--step1--#[payload]" level="INFO" doc:name="Logger"/>
• <foreach doc:name="For Each">
• <logger message="--for each--batch step1--#[payload]--" level="INFO" doc:name="Logger"/>
• <db:update config-ref="Generic_Database_Configuration" doc:name="Database">
• <db:parameterized-query><![CDATA[update mytable22 set status='batch fail' where num=#[payload]]]></db:parameterized-query>
• </db:update>
• </foreach>
• </batch:step>
• </batch:process-records>
• <batch:on-complete>
• <logger message="--complete--#[message.payload]" level="INFO" doc:name="Logger"/>
• </batch:on-complete>
• </batch:job>
• <flow name="SampleFlow">
• <http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>
• <logger level="INFO" doc:name="Logger" message="--Hai"/>
• <expression-component doc:name="Expression"><![CDATA[import java.util.List;
• import java.util.Map;
• import java.util.ArrayList;
• import java.util.HashMap;
• List l1 = new ArrayList();
• Map m2 = new HashMap();
• m2.put("b","2");
• m2.put("c","3");
• l1.add(m2);
• Map m1 = new HashMap();
• m1.put("a","1");
• l1.add(m1);
• Map m4 = new HashMap();
• m4.put("e","5");
• l1.add(m4);
• Map m3 = new HashMap();
• m3.put("d","4");
• l1.add(m3);
• payload = l1;
• return payload;]]></expression-component>
• <logger message="--main flow--#[payload]" level="INFO" doc:name="Logger"/>
• <batch:execute name="SampleBatch" doc:name="SampleBatch"/>
• </flow>
• </mule>
• Output:
• Data in DB:
• Before execute:
After execute:
• INFO 2016-05-28 18:51:48,882 [main] org.mule.module.launcher.MuleDeploymentService:
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• + Started app 'Sample' +
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• INFO 2016-05-28 18:51:48,886 [main] org.mule.module.launcher.DeploymentDirectoryWatcher:
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• + Mule is up and kicking (every 5000ms) +
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• INFO 2016-05-28 18:51:49,040 [main] org.mule.module.launcher.StartupSummaryDeploymentListener:
• **********************************************************************
• * - - + DOMAIN + - - * - - + STATUS + - - *
• **********************************************************************
• * default * DEPLOYED *
• **********************************************************************
• *******************************************************************************************************
• * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
• *******************************************************************************************************
• * Sample * default * DEPLOYED *
• *******************************************************************************************************
• INFO 2016-05-28 18:51:53,201 [[Sample].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: --Hai
• INFO 2016-05-28 18:51:53,253 [[Sample].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: --main flow--[{b=2, c=3}, {a=1}, {e=5}, {d=4}]
• INFO 2016-05-28 18:51:53,354 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Created instance dc959d50-24fc-11e6-b3de-
30d420524153 for batch job SampleBatch
• INFO 2016-05-28 18:51:53,359 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Batch job SampleBatch has no input phase.
Creating job instance
• INFO 2016-05-28 18:51:53,383 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.queue.BatchQueueLoader: Starting loading phase for instance
'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'
• INFO 2016-05-28 18:51:53,548 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.queue.BatchQueueLoader: Finished loading phase for instance
dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch. 4 records were loaded
• INFO 2016-05-28 18:51:53,562 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Started execution of instance 'dc959d50-
24fc-11e6-b3de-30d420524153' of job 'SampleBatch'
• INFO 2016-05-28 18:51:53,711 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{b=2, c=3}--
• INFO 2016-05-28 18:51:53,713 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--2
• INFO 2016-05-28 18:52:00,519 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--3
• INFO 2016-05-28 18:52:00,605 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{a=1}--
• INFO 2016-05-28 18:52:00,605 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--1
• INFO 2016-05-28 18:52:00,617 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{e=5}--
• INFO 2016-05-28 18:52:00,617 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--5
• INFO 2016-05-28 18:52:02,765 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Found exception processing record on step 'Batch_Step' for job
instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'.
• This is the first record to show this exception on this step for this job instance. Subsequent records with the same failureswill not be logged for performance and log readability reasons:
• ********************************************************************************
• Message : String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String
• Type : org.mule.api.MessagingException
• Code : MULE_ERROR--2
• Payload : 5
• JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
• ********************************************************************************
• Exception stack is:
• 1. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException)
• com.microsoft.sqlserver.jdbc.SQLServerException:216 (null)
• 2. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String (org.mule.api.MessagingException)
• org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
• ********************************************************************************
• Root Exception stack trace:
• com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
• at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
• at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
• at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
• at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.executeUpdate(NoAutoGeneratedKeyStrategy.java:55)
• at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:43)
• at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:48)
• at org.mule.module.db.internal.processor.UpdateMessageProcessor.doExecuteQuery(UpdateMessageProcessor.java:59)
• at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42)
• at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.routing.AbstractSelectiveRouter.processEventWithProcessor(AbstractSelectiveRouter.java:303)
• at org.mule.routing.AbstractSelectiveRouter.routeWithProcessors(AbstractSelectiveRouter.java:293)
• at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:193)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:129)
• at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule...
• ********************************************************************************
• INFO 2016-05-28 18:52:02,768 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Found exception processing record on step 'Batch_Step' for job
instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'.
• This is the first record to show this exception on this step for this job instance. Subsequent records with the same failureswill not be logged for performance and log readability reasons:
• ********************************************************************************
• Message : String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String
• Type : org.mule.api.MessagingException
• Code : MULE_ERROR--2
• Payload : 5
• JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
• ********************************************************************************
• Exception stack is:
• 1. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException)
• com.microsoft.sqlserver.jdbc.SQLServerException:216 (null)
• 2. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String (org.mule.api.MessagingException)
• org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
• ********************************************************************************
• Root Exc
• com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
• at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
• at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) eption stack trace:
• at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
• at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
• at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
• at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.executeUpdate(NoAutoGeneratedKeyStrategy.java:55)
• at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:43)
• at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:48)
• at org.mule.module.db.internal.processor.UpdateMessageProcessor.doExecuteQuery(UpdateMessageProcessor.java:59)
• at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42)
• at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.routing.AbstractSelectiveRouter.processEventWithProcessor(AbstractSelectiveRouter.java:303)
• at org.mule.routing.AbstractSelectiveRouter.routeWithProcessors(AbstractSelectiveRouter.java:293)
• at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:193)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:129)
• at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
• at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
• at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
• at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
• at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
• at org.mule...
• ********************************************************************************
• INFO 2016-05-28 18:52:02,769 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{d=4}--
• INFO 2016-05-28 18:52:02,769 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--
4
• INFO 2016-05-28 18:52:03,049 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Step Batch_Step finished
processing all records for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch
• INFO 2016-05-28 18:52:03,095 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --step1--{e=5}
• INFO 2016-05-28 18:52:03,096 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --for each--batch
step1--5--
• INFO 2016-05-28 18:52:03,488 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Starting
execution of onComplete phase for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch
• INFO 2016-05-28 18:52:03,508 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --complete--
com.mulesoft.module.batch.ImmutableBatchJobResult@1fa547d1
• INFO 2016-05-28 18:52:03,509 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Finished
execution of onComplete phase for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch
• INFO 2016-05-28 18:52:03,509 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Finished
execution for instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'. Total Records processed: 4. Successful records: 3. Failed
Records: 1
• INFO 2016-05-28 18:52:03,511 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine:
• *************************************************************************************************************************
***************************************
• * - - + Exception Type + - - * - - + Step + - - * - - + Count + - - *
• *************************************************************************************************************************
***************************************
• * com.mulesoft.module.batch.exception.BatchException * Batch_Step * 1 *
• *************************************************************************************************************************
***************************************
• INFO 2016-05-28 18:52:03,524 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.DefaultBatchStep: Step Batch_Step1
finished processing all records for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8089
2. a. Service will update the status to ‘Success’ for
the records whose num is other than 5
b. It will fail while trying to update the status as
‘successsuccesssuccesssuccesssuccesssuccess’ for
the num 5 because the length of the status excides
the size of the column. Hence, the failed map will
process in Batch_Step1 and will update the status
as ‘batch fail’ for the record whose num is 5
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.6/batch-processing

More Related Content

What's hot

Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptx
vishal choudhary
 
PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummies
Tatiana Al-Chueyr
 
Real-time Stream Processing with Apache Flink @ Hadoop Summit
Real-time Stream Processing with Apache Flink @ Hadoop SummitReal-time Stream Processing with Apache Flink @ Hadoop Summit
Real-time Stream Processing with Apache Flink @ Hadoop Summit
Gyula Fóra
 
Introduction to Twitter Storm
Introduction to Twitter StormIntroduction to Twitter Storm
Introduction to Twitter Storm
Uwe Printz
 
Distributed real time stream processing- why and how
Distributed real time stream processing- why and howDistributed real time stream processing- why and how
Distributed real time stream processing- why and how
Petr Zapletal
 
Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop
Rajesh Ananda Kumar
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetup
Ananth Padmanabhan
 
Hadoop Summit Europe 2014: Apache Storm Architecture
Hadoop Summit Europe 2014: Apache Storm ArchitectureHadoop Summit Europe 2014: Apache Storm Architecture
Hadoop Summit Europe 2014: Apache Storm Architecture
P. Taylor Goetz
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
Michael Renner
 
BD-zero lecture.pptx
BD-zero lecture.pptxBD-zero lecture.pptx
BD-zero lecture.pptx
vishal choudhary
 
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
vishal choudhary
 
Hadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep InsightHadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep Insight
Hanborq Inc.
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnit
Eric Wendelin
 
An Introduction To PostgreSQL Triggers
An Introduction To PostgreSQL TriggersAn Introduction To PostgreSQL Triggers
An Introduction To PostgreSQL Triggers
Jim Mlodgenski
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
InfluxData
 
Moving In: how to port your content from * to Drupal
Moving In: how to port your content from * to DrupalMoving In: how to port your content from * to Drupal
Moving In: how to port your content from * to Drupal
Emma Jane Hogbin Westby
 
An introduction to Test Driven Development on MapReduce
An introduction to Test Driven Development on MapReduceAn introduction to Test Driven Development on MapReduce
An introduction to Test Driven Development on MapReduce
Ananth PackkilDurai
 
MAVRL Workshop 2014 - pymatgen-db & custodian
MAVRL Workshop 2014 - pymatgen-db & custodianMAVRL Workshop 2014 - pymatgen-db & custodian
MAVRL Workshop 2014 - pymatgen-db & custodian
University of California, San Diego
 
Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model exam
Indhujeni
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
ragho
 

What's hot (20)

Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptx
 
PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummies
 
Real-time Stream Processing with Apache Flink @ Hadoop Summit
Real-time Stream Processing with Apache Flink @ Hadoop SummitReal-time Stream Processing with Apache Flink @ Hadoop Summit
Real-time Stream Processing with Apache Flink @ Hadoop Summit
 
Introduction to Twitter Storm
Introduction to Twitter StormIntroduction to Twitter Storm
Introduction to Twitter Storm
 
Distributed real time stream processing- why and how
Distributed real time stream processing- why and howDistributed real time stream processing- why and how
Distributed real time stream processing- why and how
 
Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetup
 
Hadoop Summit Europe 2014: Apache Storm Architecture
Hadoop Summit Europe 2014: Apache Storm ArchitectureHadoop Summit Europe 2014: Apache Storm Architecture
Hadoop Summit Europe 2014: Apache Storm Architecture
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
 
BD-zero lecture.pptx
BD-zero lecture.pptxBD-zero lecture.pptx
BD-zero lecture.pptx
 
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
 
Hadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep InsightHadoop MapReduce Introduction and Deep Insight
Hadoop MapReduce Introduction and Deep Insight
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnit
 
An Introduction To PostgreSQL Triggers
An Introduction To PostgreSQL TriggersAn Introduction To PostgreSQL Triggers
An Introduction To PostgreSQL Triggers
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
 
Moving In: how to port your content from * to Drupal
Moving In: how to port your content from * to DrupalMoving In: how to port your content from * to Drupal
Moving In: how to port your content from * to Drupal
 
An introduction to Test Driven Development on MapReduce
An introduction to Test Driven Development on MapReduceAn introduction to Test Driven Development on MapReduce
An introduction to Test Driven Development on MapReduce
 
MAVRL Workshop 2014 - pymatgen-db & custodian
MAVRL Workshop 2014 - pymatgen-db & custodianMAVRL Workshop 2014 - pymatgen-db & custodian
MAVRL Workshop 2014 - pymatgen-db & custodian
 
Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model exam
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
 

Viewers also liked

Душевые кабины Friges – Приложение 5 от Stockist Italy
Душевые кабины Friges – Приложение 5 от Stockist Italy Душевые кабины Friges – Приложение 5 от Stockist Italy
Душевые кабины Friges – Приложение 5 от Stockist Italy
P.L.T. Forniture Industriali S.r.l.
 
13CSP
13CSP13CSP
Daniela vrnoga
Daniela vrnogaDaniela vrnoga
Daniela vrnoga
Daniela Vrnoga
 
Reference Enquiry Form Kim 210568
Reference Enquiry Form Kim 210568Reference Enquiry Form Kim 210568
Reference Enquiry Form Kim 210568
Kim Kj
 
Mule esb with amazon s3 Integration
Mule esb with amazon s3 IntegrationMule esb with amazon s3 Integration
Mule esb with amazon s3 Integration
sivachandra mandalapu
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
sivachandra mandalapu
 
Overview of GST
Overview of GSTOverview of GST
Overview of GST
Mitesh Katira
 
Laudo de tcnicod e vistoria predial
Laudo de tcnicod e vistoria predial Laudo de tcnicod e vistoria predial
Laudo de tcnicod e vistoria predial
Wallace Stanford
 
Children’s book
Children’s bookChildren’s book
Children’s book
bobbiehaslam
 
Apostila engenharia civil concreto armado recomendacoes
Apostila engenharia civil concreto armado recomendacoesApostila engenharia civil concreto armado recomendacoes
Apostila engenharia civil concreto armado recomendacoes
Edson D. Vizentin
 
EENA 2016 - Customer service in a PSAP (2/3)
EENA 2016 - Customer service in a PSAP (2/3)EENA 2016 - Customer service in a PSAP (2/3)
EENA 2016 - Customer service in a PSAP (2/3)
EENA (European Emergency Number Association)
 
Cadbury marketing stratergy
Cadbury marketing stratergyCadbury marketing stratergy
Cadbury marketing stratergy
Payal Golui
 
7aloulaaaaaaaa projet final
7aloulaaaaaaaa projet final7aloulaaaaaaaa projet final
7aloulaaaaaaaa projet final
hala youness
 
Les instruments musicales
Les instruments musicalesLes instruments musicales
Les instruments musicales
hala youness
 

Viewers also liked (15)

Душевые кабины Friges – Приложение 5 от Stockist Italy
Душевые кабины Friges – Приложение 5 от Stockist Italy Душевые кабины Friges – Приложение 5 от Stockist Italy
Душевые кабины Friges – Приложение 5 от Stockist Italy
 
13CSP
13CSP13CSP
13CSP
 
Daniela vrnoga
Daniela vrnogaDaniela vrnoga
Daniela vrnoga
 
Reference Enquiry Form Kim 210568
Reference Enquiry Form Kim 210568Reference Enquiry Form Kim 210568
Reference Enquiry Form Kim 210568
 
Eng Council CEng
Eng Council CEngEng Council CEng
Eng Council CEng
 
Mule esb with amazon s3 Integration
Mule esb with amazon s3 IntegrationMule esb with amazon s3 Integration
Mule esb with amazon s3 Integration
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
 
Overview of GST
Overview of GSTOverview of GST
Overview of GST
 
Laudo de tcnicod e vistoria predial
Laudo de tcnicod e vistoria predial Laudo de tcnicod e vistoria predial
Laudo de tcnicod e vistoria predial
 
Children’s book
Children’s bookChildren’s book
Children’s book
 
Apostila engenharia civil concreto armado recomendacoes
Apostila engenharia civil concreto armado recomendacoesApostila engenharia civil concreto armado recomendacoes
Apostila engenharia civil concreto armado recomendacoes
 
EENA 2016 - Customer service in a PSAP (2/3)
EENA 2016 - Customer service in a PSAP (2/3)EENA 2016 - Customer service in a PSAP (2/3)
EENA 2016 - Customer service in a PSAP (2/3)
 
Cadbury marketing stratergy
Cadbury marketing stratergyCadbury marketing stratergy
Cadbury marketing stratergy
 
7aloulaaaaaaaa projet final
7aloulaaaaaaaa projet final7aloulaaaaaaaa projet final
7aloulaaaaaaaa projet final
 
Les instruments musicales
Les instruments musicalesLes instruments musicales
Les instruments musicales
 

Similar to How to use batch component

How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
prathyusha vadla
 
J unit
J unitJ unit
Junit in mule
Junit in muleJunit in mule
Junit in mule
Sunil Komarapu
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
F K
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
AbdulImrankhan7
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
javeed_mhd
 
Data herding
Data herdingData herding
Data herding
unbracketed
 
Data herding
Data herdingData herding
Data herding
unbracketed
 
For each component
For each component For each component
For each component
F K
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
javeed_mhd
 
For each component
For each component For each component
For each component
AbdulImrankhan7
 
For each component
For each component For each component
For each component
Sunil Komarapu
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
Ihor Bobak
 
For Each Component
For Each ComponentFor Each Component
For Each Component
Durga Prasad Kakarla
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
Nathan Handler
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each component
maheshtheapex
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
sivachandra mandalapu
 
TYPO3 Scheduler
TYPO3 SchedulerTYPO3 Scheduler
TYPO3 Scheduler
Krystian Szymukowicz
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with Mule
Bui Kiet
 

Similar to How to use batch component (20)

How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
 
J unit
J unitJ unit
J unit
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Data herding
Data herdingData herding
Data herding
 
Data herding
Data herdingData herding
Data herding
 
For each component
For each component For each component
For each component
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
For each component
For each component For each component
For each component
 
For each component
For each component For each component
For each component
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
For Each Component
For Each ComponentFor Each Component
For Each Component
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each component
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
TYPO3 Scheduler
TYPO3 SchedulerTYPO3 Scheduler
TYPO3 Scheduler
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with Mule
 

More from sivachandra mandalapu

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
sivachandra mandalapu
 
Jms selector
Jms selectorJms selector
Jms selector
sivachandra mandalapu
 
Sftplite
SftpliteSftplite
Object store
Object storeObject store
Object store
sivachandra mandalapu
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
sivachandra mandalapu
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
sivachandra mandalapu
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
sivachandra mandalapu
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
sivachandra mandalapu
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
sivachandra mandalapu
 
Validation
ValidationValidation
Property place holder
Property place holderProperty place holder
Property place holder
sivachandra mandalapu
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
sivachandra mandalapu
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
sivachandra mandalapu
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
sivachandra mandalapu
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
sivachandra mandalapu
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
sivachandra mandalapu
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
sivachandra mandalapu
 
Splitter
SplitterSplitter
Expression
ExpressionExpression
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
sivachandra mandalapu
 

More from sivachandra mandalapu (20)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Sftplite
SftpliteSftplite
Sftplite
 
Object store
Object storeObject store
Object store
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
Validation
ValidationValidation
Validation
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Splitter
SplitterSplitter
Splitter
 
Expression
ExpressionExpression
Expression
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 

Recently uploaded

220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
lakshayrojroj
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
7DFarhanaMohammed
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
Taste
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
Celine George
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 

Recently uploaded (20)

220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 

How to use batch component

  • 1. How to use Batch component 28-05-2015
  • 2. Abstract • The main motto of this PPT is How to use Batch component in our applications.
  • 3. Introduction • Mule possesses the ability to process messages in batches. Within an application, you can initiate a batch job which is a block of code that splits messages into individual records, performs actions upon each record, then reports on the results and potentially pushes the processed output to other systems or queues. This functionality is particularly useful when working with streaming input or when engineering "near real-time" data integration between SaaS applications.
  • 5. .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" • xmlns:spring="http://www.springframework.org/schema/beans" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd • http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd • http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd • http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd"> • <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8089" doc:name="HTTP Listener Configuration"/> • <db:generic-config name="Generic_Database_Configuration" url="jdbc:sqlserver://localhost:1433;databaseName=SOA_VMES_DB;user=****;password=****;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration"/> • <batch:job name="SampleBatch" max-failed-records="-1"> • <batch:process-records> • <batch:step name="Batch_Step"> • <logger message="--Batch step--#[payload]--" level="INFO" doc:name="Logger"/> • <foreach doc:name="For Each"> • <logger message="--for each--batch step--#[payload]" level="INFO" doc:name="Logger"/> • <choice doc:name="Choice"> • <when expression="#[payload==5]"> • <db:update config-ref="Generic_Database_Configuration" doc:name="Database"> • <db:parameterized-query><![CDATA[update mytable22 set status='successsuccesssuccesssuccesssuccesssuccess' where num=#[payload]]]></db:parameterized-query> • </db:update> • </when> • <otherwise> • <db:update config-ref="Generic_Database_Configuration" doc:name="Database"> • <db:parameterized-query><![CDATA[update mytable22 set status='Success' where num=#[payload]]]></db:parameterized-query> • </db:update> • </otherwise> • </choice> • </foreach> • </batch:step>
  • 6. • <batch:step name="Batch_Step1" accept-policy="ONLY_FAILURES"> • <logger message="--step1--#[payload]" level="INFO" doc:name="Logger"/> • <foreach doc:name="For Each"> • <logger message="--for each--batch step1--#[payload]--" level="INFO" doc:name="Logger"/> • <db:update config-ref="Generic_Database_Configuration" doc:name="Database"> • <db:parameterized-query><![CDATA[update mytable22 set status='batch fail' where num=#[payload]]]></db:parameterized-query> • </db:update> • </foreach> • </batch:step> • </batch:process-records> • <batch:on-complete> • <logger message="--complete--#[message.payload]" level="INFO" doc:name="Logger"/> • </batch:on-complete> • </batch:job> • <flow name="SampleFlow"> • <http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/> • <logger level="INFO" doc:name="Logger" message="--Hai"/> • <expression-component doc:name="Expression"><![CDATA[import java.util.List; • import java.util.Map; • import java.util.ArrayList; • import java.util.HashMap; • List l1 = new ArrayList(); • Map m2 = new HashMap(); • m2.put("b","2"); • m2.put("c","3"); • l1.add(m2); • Map m1 = new HashMap(); • m1.put("a","1"); • l1.add(m1); • Map m4 = new HashMap(); • m4.put("e","5"); • l1.add(m4); • Map m3 = new HashMap(); • m3.put("d","4"); • l1.add(m3); • payload = l1; • return payload;]]></expression-component> • <logger message="--main flow--#[payload]" level="INFO" doc:name="Logger"/> • <batch:execute name="SampleBatch" doc:name="SampleBatch"/> • </flow> • </mule>
  • 7. • Output: • Data in DB: • Before execute: After execute:
  • 8. • INFO 2016-05-28 18:51:48,882 [main] org.mule.module.launcher.MuleDeploymentService: • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • + Started app 'Sample' + • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • INFO 2016-05-28 18:51:48,886 [main] org.mule.module.launcher.DeploymentDirectoryWatcher: • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • + Mule is up and kicking (every 5000ms) + • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • INFO 2016-05-28 18:51:49,040 [main] org.mule.module.launcher.StartupSummaryDeploymentListener: • ********************************************************************** • * - - + DOMAIN + - - * - - + STATUS + - - * • ********************************************************************** • * default * DEPLOYED * • ********************************************************************** • ******************************************************************************************************* • * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - * • ******************************************************************************************************* • * Sample * default * DEPLOYED * • ******************************************************************************************************* • INFO 2016-05-28 18:51:53,201 [[Sample].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: --Hai • INFO 2016-05-28 18:51:53,253 [[Sample].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: --main flow--[{b=2, c=3}, {a=1}, {e=5}, {d=4}] • INFO 2016-05-28 18:51:53,354 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Created instance dc959d50-24fc-11e6-b3de- 30d420524153 for batch job SampleBatch • INFO 2016-05-28 18:51:53,359 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Batch job SampleBatch has no input phase. Creating job instance • INFO 2016-05-28 18:51:53,383 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.queue.BatchQueueLoader: Starting loading phase for instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch' • INFO 2016-05-28 18:51:53,548 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.queue.BatchQueueLoader: Finished loading phase for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch. 4 records were loaded • INFO 2016-05-28 18:51:53,562 [[Sample].HTTP_Listener_Configuration.worker.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Started execution of instance 'dc959d50- 24fc-11e6-b3de-30d420524153' of job 'SampleBatch' • INFO 2016-05-28 18:51:53,711 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{b=2, c=3}-- • INFO 2016-05-28 18:51:53,713 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--2 • INFO 2016-05-28 18:52:00,519 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--3 • INFO 2016-05-28 18:52:00,605 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{a=1}-- • INFO 2016-05-28 18:52:00,605 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--1 • INFO 2016-05-28 18:52:00,617 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{e=5}-- • INFO 2016-05-28 18:52:00,617 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step--5 • INFO 2016-05-28 18:52:02,765 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Found exception processing record on step 'Batch_Step' for job instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'. • This is the first record to show this exception on this step for this job instance. Subsequent records with the same failureswill not be logged for performance and log readability reasons:
  • 9. • ******************************************************************************** • Message : String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String • Type : org.mule.api.MessagingException • Code : MULE_ERROR--2 • Payload : 5 • JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html • ******************************************************************************** • Exception stack is: • 1. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException) • com.microsoft.sqlserver.jdbc.SQLServerException:216 (null) • 2. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String (org.mule.api.MessagingException) • org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) • ******************************************************************************** • Root Exception stack trace: • com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated. • at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) • at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) • at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314) • at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.executeUpdate(NoAutoGeneratedKeyStrategy.java:55) • at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:43) • at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:48) • at org.mule.module.db.internal.processor.UpdateMessageProcessor.doExecuteQuery(UpdateMessageProcessor.java:59) • at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42) • at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.routing.AbstractSelectiveRouter.processEventWithProcessor(AbstractSelectiveRouter.java:303) • at org.mule.routing.AbstractSelectiveRouter.routeWithProcessors(AbstractSelectiveRouter.java:293)
  • 10. • at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:193) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:129) • at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule... • ******************************************************************************** • INFO 2016-05-28 18:52:02,768 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Found exception processing record on step 'Batch_Step' for job instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'. • This is the first record to show this exception on this step for this job instance. Subsequent records with the same failureswill not be logged for performance and log readability reasons: • ******************************************************************************** • Message : String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String • Type : org.mule.api.MessagingException • Code : MULE_ERROR--2 • Payload : 5 • JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html • ******************************************************************************** • Exception stack is: • 1. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException) • com.microsoft.sqlserver.jdbc.SQLServerException:216 (null) • 2. String or binary data would be truncated. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: String (org.mule.api.MessagingException) • org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) • ******************************************************************************** • Root Exc • com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated. • at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) • at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) eption stack trace:
  • 11. • at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) • at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) • at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314) • at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.executeUpdate(NoAutoGeneratedKeyStrategy.java:55) • at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:43) • at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:48) • at org.mule.module.db.internal.processor.UpdateMessageProcessor.doExecuteQuery(UpdateMessageProcessor.java:59) • at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42) • at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.routing.AbstractSelectiveRouter.processEventWithProcessor(AbstractSelectiveRouter.java:303) • at org.mule.routing.AbstractSelectiveRouter.routeWithProcessors(AbstractSelectiveRouter.java:293) • at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:193) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:129) • at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) • at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) • at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) • at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) • at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) • at org.mule... • ********************************************************************************
  • 12. • INFO 2016-05-28 18:52:02,769 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --Batch step--{d=4}-- • INFO 2016-05-28 18:52:02,769 [batch-job-SampleBatch-work-manager.01] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step-- 4 • INFO 2016-05-28 18:52:03,049 [batch-job-SampleBatch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Step Batch_Step finished processing all records for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch • INFO 2016-05-28 18:52:03,095 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --step1--{e=5} • INFO 2016-05-28 18:52:03,096 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --for each--batch step1--5-- • INFO 2016-05-28 18:52:03,488 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Starting execution of onComplete phase for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch • INFO 2016-05-28 18:52:03,508 [batch-job-SampleBatch-work-manager.02] org.mule.api.processor.LoggerMessageProcessor: --complete-- com.mulesoft.module.batch.ImmutableBatchJobResult@1fa547d1 • INFO 2016-05-28 18:52:03,509 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Finished execution of onComplete phase for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch • INFO 2016-05-28 18:52:03,509 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: Finished execution for instance 'dc959d50-24fc-11e6-b3de-30d420524153' of job 'SampleBatch'. Total Records processed: 4. Successful records: 3. Failed Records: 1 • INFO 2016-05-28 18:52:03,511 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.engine.DefaultBatchEngine: • ************************************************************************************************************************* *************************************** • * - - + Exception Type + - - * - - + Step + - - * - - + Count + - - * • ************************************************************************************************************************* *************************************** • * com.mulesoft.module.batch.exception.BatchException * Batch_Step * 1 * • ************************************************************************************************************************* *************************************** • INFO 2016-05-28 18:52:03,524 [batch-job-SampleBatch-work-manager.02] com.mulesoft.module.batch.DefaultBatchStep: Step Batch_Step1 finished processing all records for instance dc959d50-24fc-11e6-b3de-30d420524153 of job SampleBatch
  • 13. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8089 2. a. Service will update the status to ‘Success’ for the records whose num is other than 5 b. It will fail while trying to update the status as ‘successsuccesssuccesssuccesssuccesssuccess’ for the num 5 because the length of the status excides the size of the column. Hence, the failed map will process in Batch_Step1 and will update the status as ‘batch fail’ for the record whose num is 5