camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > SpringBatch
Date Wed, 06 Jun 2012 12:26:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/SpringBatch">SpringBatch</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~hekonsek">Henryk
Konsek</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{warning} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
Job execution <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
Usage <br></td></tr>
            <tr><td class="diff-unchanged" > <br>When Spring Batch component
receives the message, it triggers the job execution. The job will be executed using the {{org.springframework.batch.core.launch.JobLaucher}}
instance resolved according to the following algorithm: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="SpringBatch-SpringBatchComponent"></a>Spring Batch
Component</h2>

<p>The <b>spring-batch:</b> component and support classes provide integration
bridge between Camel and <a href="http://www.springsource.org/spring-batch" class="external-link"
rel="nofollow">Spring Batch</a> infrastructure.</p>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-spring-batch<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same
version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h3><a name="SpringBatch-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
spring-batch:jobName[?options]
</pre>
</div></div>
<p>Where <b>jobName</b> represents the name of the Spring Batch job located
in the Camel registry.</p>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td>This component can
only be used to define producer endpoints, which means that you cannot use the Spring Batch
component in a <tt>from()</tt> statement.</td></tr></table></div>

<h3><a name="SpringBatch-Usage"></a>Usage</h3>

<p>When Spring Batch component receives the message, it triggers the job execution.
The job will be executed using the <tt>org.springframework.batch.core.launch.JobLaucher</tt>
instance resolved according to the following algorithm:</p>
<ul>
	<li>if <tt>JobLauncher</tt> is manually set on the component, then use
it.</li>
	<li>if <tt>jobLauncherRef</tt> option is set on the component, then search
Camel Registry for the <tt>JobLauncher</tt> with the given name.</li>
	<li>if there is <tt>JobLauncher</tt> registered in the Camel Registry under
<b>jobLauncher</b> name, then use it.</li>
	<li>if none of the steps above allow to resolve the <tt>JobLauncher</tt>
and there is exactly one <tt>JobLauncher</tt> instance in the Camel Registry,
then use it.</li>
</ul>


<p>All headers found in the message are passed to the <tt>JobLauncher</tt>
as job parameters. <tt>String</tt>, <tt>Long</tt>, <tt>Double</tt>
and <tt>java.util.Date</tt> values are copied to the <tt>org.springframework.batch.core.JobParametersBuilder</tt>
- other data types are converted to Strings.</p>

<h3><a name="SpringBatch-Options"></a>Options</h3>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>jobLauncherRef</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.10:</b> Explicitly specifies the name
of the <tt>JobLauncher</tt> to be used.</td>
</tr>
</tbody></table>
</div>


    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/SpringBatch">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27848800&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/SpringBatch?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message