You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2016/04/13 10:07:00 UTC

svn commit: r985556 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/apache-sling-eventing-and-job-handling.html

Author: buildbot
Date: Wed Apr 13 08:07:00 2016
New Revision: 985556

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/apache-sling-eventing-and-job-handling.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Apr 13 08:07:00 2016
@@ -1 +1 @@
-1738689
+1738907

Modified: websites/staging/sling/trunk/content/documentation/bundles/apache-sling-eventing-and-job-handling.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/apache-sling-eventing-and-job-handling.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/apache-sling-eventing-and-job-handling.html Wed Apr 13 08:07:00 2016
@@ -130,7 +130,12 @@ h2:hover > .headerlink, h3:hover > .head
 <h2 id="jobs-guarantee-of-processing">Jobs (Guarantee of Processing)<a class="headerlink" href="#jobs-guarantee-of-processing" title="Permanent link">&para;</a></h2>
 <p>In general, the eventing mechanism (OSGi EventAdmin) has no knowledge about the contents of an event. Therefore, it can't decide if an event is important and should be processed by someone. As the event mechanism is a "fire event and forget about it" algorithm, there is no way for an event admin to tell if someone has really processed the event. Processing of an event could fail, the server or bundle could be stopped etc.</p>
 <p>On the other hand, there are use cases where the guarantee of processing is a must and usually this comes with the requirement of processing exactly once. Typical examples are sending notification emails (or sms), post processing of content (like thumbnail generation of images or documents), workflow steps etc.</p>
-<p>The Sling Event Support adds the notion of a job. A job is a special event that has to be processed exactly once. To be precise, the processing guarantee is at most once. However, the time window for a single job where exactly once is very small and only happens if the instance which processes a job crashes after the job processing is finished but before this state is persisted. Therefore a job consumer should be prepared to process a job more than once.</p>
+<p>The Sling Event Support adds the notion of a job. A job is a special event that has to be processed exactly once. 
+To be precise, the processing guarantee is at most once. However, the time window for a single job where exactly 
+once can't be guaranteed is very small. It happens if the instance which processes a job crashes after the job 
+processing is finished but before this state is persisted. Therefore a job consumer should be prepared to process
+a job more than once. Of course, if there is no job consumer for a job, the job is never processed. However this
+is considered a deployment error.</p>
 <p>The Sling Jobs Processing adds some overhead, so in some cases it might be better to use just the <a href="/documentation/bundles/scheduler-service-commons-scheduler.html">Commons Scheduler Service</a> or the <a href="/documentation/bundles/apache-sling-commons-thread-pool.html">Commons Thread Pool</a> for asynchronous execution of code.</p>
 <p>While older versions of the job handling were based on sending and receiving events through the OSGi event admin, newer versions provide enhanced support through special Java interface. This approach is preferred over the still supported but deprecated event admin way.</p>
 <p>A job consists of two parts, the job topic describing the nature of the job and the payload which is a key value map of serializable objects. A client can initiate a job by calling the <em>JobManager.addJob</em> method:</p>
@@ -289,7 +294,7 @@ h2:hover > .headerlink, h3:hover > .head
 <h2 id="sending-scheduled-events">Sending Scheduled Events<a class="headerlink" href="#sending-scheduled-events" title="Permanent link">&para;</a></h2>
 <p>Scheduled events are OSGi events that have been created by the environemnt. They are generated on each application node of the cluster through an own scheduler instance. Sending these events works the same as sending events based on JCR events (see above).</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1738515 by kwin on Mon, 11 Apr 2016 06:39:26 +0000
+        Rev. 1738907 by cziegeler on Wed, 13 Apr 2016 08:06:43 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project