incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling > Higher level observation services
Date Thu, 02 May 2013 13:12:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=SLING&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/SLING/Higher+level+observation+services">Higher
level observation services</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~bdelacretaz">Bertrand
Delacretaz</a>
    </h4>
        <br/>
                         <h4>Changes (68)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >{style} <br></td></tr>
            <tr><td class="diff-changed-lines" >.deflist h4 { margin-top: 0; font-size:100%;
font-weight:normal; font-style:italic; <span class="diff-added-words"style="background-color:
#dfd;">color:#888888;</span> } <br></td></tr>
            <tr><td class="diff-unchanged" >  .deflist h4 + p { margin-top: 0;
 } <br>  .deflist p { margin-left: 2em; } <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{div:class=deflist} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>In-memory data structures, or &quot;compiled&quot; versions of
some content, are created when content changes. <br>h4. Typical uses <br>Configurations,
CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br>Changes in content
under specific paths (or path regexps), with optional restrictions on node types and/or event
types. <br>h4. Action <br>Clear an internal cache that is rebuilt the next time
someone needs it. <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h4.
Typical uses <br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br>Content changes
are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Content Export, Replication to Remote Systems <br>{div:class=deflist} <br>h4.
Scenario <br>Content is exported as a file or pushed to a remote system when it changes.
<br>{div} <br> <br>This is similar to the Cached Content pattern. <br>
<br></td></tr>
            <tr><td class="diff-unchanged" >h2. Content Ingestion <br>{div:class=deflist}
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>Files that are dropped into the repository are parsed or processed, resulting
in content changes and/or workflow events. <br>h4. Typical uses <br>Ingesting
digital assets, parsing incoming email or other structured files. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">A
file appears in a watched folder. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Action <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Clear
an internal cache that is rebuilt the next time someone needs it. <br>h4. Typical uses
<br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Process
the file, create the corresponding content, move the file to a &quot;processed&quot;
or &quot;rejected&quot; folder. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Content
changes are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Depends
on the application. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Performance <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Some
latency between content changes and processing is usually not a problem. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Some
latency is usually not a problem, but some applications need to process large number of files
quickly. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Potential issues <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">N
requests coming just after clearing the cache should cause just one cache rebuild, not N.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Processing
partially saved files too early can be a problem, depending on how files are added to the
repository. <br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2.
Content Export <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Content Tree Replication <br></td></tr>
            <tr><td class="diff-unchanged" >{div:class=deflist} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>Two or more content trees are kept in sync, usually with customizable mappings
and transformations. <br>h4. Typical uses <br>Management of federations of websites,
which have some common parts and some specific parts. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Fine-grained
detection of changes in a tree of content, based on paths, path regexps, node types or any
other meaningful property. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Action <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Clear
an internal cache that is rebuilt the next time someone needs it. <br>h4. Typical uses
<br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Replicate
the source tree to the target tree(s), optionally applying customizable content transformations.
<br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Content
changes are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Source
events might be quite frequent depending on authoring activity. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Performance <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Some
latency between content changes and processing is usually not a problem. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Tree
transformations might be costly and usually need to run as background jobs. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Potential issues <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">N
requests coming just after clearing the cache should cause just one cache rebuild, not N.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">An
explosion in the number of application-level and repository-level operations is possible depending
on the shape of the content tree federation and on the frequency of source content changes.
<br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br>h2. Aggregation
of changes <br>{div:class=deflist} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>Collect a number of change events over time and/or for a content subtree,
and provide an aggregated view. <br>h4. Typical uses <br>Detect and act on changes
to digital assets, without reacting to each and every small change. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Fine-grained
detection of changes in a tree of content, based on paths, path regexps, node types or any
other meaningful property. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Action <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Clear
an internal cache that is rebuilt the next time someone needs it. <br>h4. Typical uses
<br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Store
and aggregate events and deliver the results on demand. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Content
changes are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Might
be quite frequent on a busy content tree. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Performance <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Some
latency between content changes and processing is usually not a problem. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Aggregating
events efficiently, as well as storing them until they&#39;re not needed anymore, can
impact performance. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Potential issues <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">N
requests coming just after clearing the cache should cause just one cache rebuild, not N.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Might
create a noticeable load on the eventing/observation system, if listening to many detailed
events. <br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br>h2. Consistency
Checks and Fixes <br>{div:class=deflist} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>Watch specific content subtrees for specific changes (nodes moved etc.)
and react to them to avoid inconsistencies in the content. <br>h4. Typical uses <br>Adapt
paths that point to other pieces of content when content moves around. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Fine-grained
detection of changes in a tree of content, based on paths, path regexps, node types or any
other meaningful property. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Action <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Clear
an internal cache that is rebuilt the next time someone needs it. <br>h4. Typical uses
<br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Modify
content to keep it consistent <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Content
changes are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Usually
not very frequent as that&#39;s mostly meant to handle edge cases. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Performance <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Some
latency between content changes and processing is usually not a problem. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">A
time window during which content can be seen as inconsistent is often unavoidable, keeping
that window small is useful. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Potential issues <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">N
requests coming just after clearing the cache should cause just one cache rebuild, not N.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Content
must not be modified by JCR listeners, that should happen asynchronously if using JCR observation.
<br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2.
Content Replication <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Workflow/Job Trigger <br></td></tr>
            <tr><td class="diff-unchanged" >{div:class=deflist} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Scenario <br>Trigger workflows and jobs when content changes. <br>h4. Typical
uses <br>The unix print queue system is a good example, with folders named _incoming_,
_printing_, _done_, _rejected_ that store print job definitions. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Trigger <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Detection
of new content items in the _incoming_ folder(s). <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Action <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Clear
an internal cache that is rebuilt the next time someone needs it. <br>h4. Typical uses
<br>Configurations, CSS/javascript processing, Sling installer, etc. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Execute
the corresponding tasks and move the message nodes according to the results. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Frequency <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Content
changes are usually not very frequent, for the above typical uses. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Depends
on the application. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Performance <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Some
latency between content changes and processing is usually not a problem. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Depends
on the application. <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Potential issues <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">N
requests coming just after clearing the cache should cause just one cache rebuild, not N.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Locking
must be used if several job processors are competing for _incoming_ jobs. <br> <br>Distributed
processing of those jobs introduces cluster management requirements. <br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br>h2. Message
Queue <br>{div:class=deflist} <br></td></tr>
            <tr><td class="diff-changed-lines" >h4. <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Trigger</span>
<span class="diff-added-words"style="background-color: #dfd;">Scenario</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br>h4. Action <br>Clear an internal cache that is rebuilt
the next time someone needs it. <br>h4. Typical uses <br>Configurations, CSS/javascript
processing, Sling installer, etc. <br>h4. Frequency <br>Content changes are usually
not very frequent, for the above typical uses. <br>h4. Performance <br>Some latency
between content changes and processing is usually not a problem. <br>h4. Potential issues
<br>N requests coming just after clearing the cache should cause just one cache rebuild,
not N. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Implement
a simple message queue backed by a content repository subtree. <br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2.
Workflow/Job Trigger <br>{div:class=deflist} <br>h4. Trigger <br>Changes
in content under specific paths (or path regexps), with optional restrictions on node types
and/or event types. <br>h4. Action <br>Clear an internal cache that is rebuilt
the next time someone needs it. <br>h4. Typical uses <br>Configurations, CSS/javascript
processing, Sling installer, etc. <br>h4. Frequency <br>Content changes are usually
not very frequent, for the above typical uses. <br>h4. Performance <br>Some latency
between content changes and processing is usually not a problem. <br>h4. Potential issues
<br>N requests coming just after clearing the cache should cause just one cache rebuild,
not N. <br>{div} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">This
is very similar to the Workflow/Job trigger use case: messages are exchanged between producers
and consumers. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type="text/css">

   .deflist h4 { margin-top: 0; font-size:100%; font-weight:normal; font-style:italic; color:#888888;
}
  .deflist h4 + p { margin-top: 0;  }
  .deflist p { margin-left: 2em; }
  .deflist ul, .deflist ol { margin-left: 2em }

</style>

<p>Analyzing how we use observation in our Sling-based apps shows a number of recurring
patterns, described in this page.</p>

<p>Using JCR observation directly or Sling OSGi events does not make a big difference
in the final results, but the implementations are very different. The commit hooks provided
by <a href="http://jackrabbit.apache.org/oak/" class="external-link" rel="nofollow">http://jackrabbit.apache.org/oak/</a>
provide yet another way of observing content changes, which might be more efficient or scalable
in some cases.</p>

<p>Being able to express these common observation patterns as higher-level services,
if we can do that, would allow for switching the underlying implementation seamlessly, and
would also help promote best practices in how we use events, by minimizing the amount of code
to write at the application level.</p>

<h1><a name="Higherlevelobservationservices-Observationusagepatterns"></a>Observation
usage patterns</h1>
<p>Let's list the frequent patterns that we see w.r.t observing changes in content.</p>

<h2><a name="Higherlevelobservationservices-CachedContent"></a>Cached Content</h2>

<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>In-memory data structures, or "compiled" versions of some content, are created when
content changes.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>Configurations, CSS/javascript processing, Sling installer, etc.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>Changes in content under specific paths (or path regexps), with optional restrictions
on node types and/or event types.</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Clear an internal cache that is rebuilt the next time someone needs it.</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Content changes are usually not very frequent, for the above typical uses.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>Some latency between content changes and processing is usually not a problem.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>N requests coming just after clearing the cache should cause just one cache rebuild,
not N.</p></div>

<h2><a name="Higherlevelobservationservices-ContentExport%2CReplicationtoRemoteSystems"></a>Content
Export, Replication to Remote Systems</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Content is exported as a file or pushed to a remote system when it changes.</p></div>

<p>This is similar to the Cached Content pattern.</p>

<h2><a name="Higherlevelobservationservices-ContentIngestion"></a>Content
Ingestion</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Files that are dropped into the repository are parsed or processed, resulting in
content changes and/or workflow events.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>Ingesting digital assets, parsing incoming email or other structured files.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>A file appears in a watched folder.</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Process the file, create the corresponding content, move the file to a "processed"
or "rejected" folder.</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Depends on the application.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>Some latency is usually not a problem, but some applications need to process large
number of files quickly.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>Processing partially saved files too early can be a problem, depending on how files
are added to the repository.</p></div>

<h2><a name="Higherlevelobservationservices-ContentTreeReplication"></a>Content
Tree Replication</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Two or more content trees are kept in sync, usually with customizable mappings and
transformations.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>Management of federations of websites, which have some common parts and some specific
parts.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>Fine-grained detection of changes in a tree of content, based on paths, path regexps,
node types or any other meaningful property.</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Replicate the source tree to the target tree(s), optionally applying customizable
content transformations.</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Source events might be quite frequent depending on authoring activity.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>Tree transformations might be costly and usually need to run as background jobs.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>An explosion in the number of application-level and repository-level operations is
possible depending on the shape of the content tree federation and on the frequency of source
content changes.</p></div>

<h2><a name="Higherlevelobservationservices-Aggregationofchanges"></a>Aggregation
of changes</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Collect a number of change events over time and/or for a content subtree, and provide
an aggregated view.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>Detect and act on changes to digital assets, without reacting to each and every small
change.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>Fine-grained detection of changes in a tree of content, based on paths, path regexps,
node types or any other meaningful property.</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Store and aggregate events and deliver the results on demand.</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Might be quite frequent on a busy content tree.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>Aggregating events efficiently, as well as storing them until they're not needed
anymore, can impact performance.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>Might create a noticeable load on the eventing/observation system, if listening to
many detailed events.</p></div>

<h2><a name="Higherlevelobservationservices-ConsistencyChecksandFixes"></a>Consistency
Checks and Fixes</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Watch specific content subtrees for specific changes (nodes moved etc.) and react
to them to avoid inconsistencies in the content.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>Adapt paths that point to other pieces of content when content moves around.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>Fine-grained detection of changes in a tree of content, based on paths, path regexps,
node types or any other meaningful property.</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Modify content to keep it consistent</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Usually not very frequent as that's mostly meant to handle edge cases.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>A time window during which content can be seen as inconsistent is often unavoidable,
keeping that window small is useful.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>Content must not be modified by JCR listeners, that should happen asynchronously
if using JCR observation.</p></div>

<h2><a name="Higherlevelobservationservices-Workflow%2FJobTrigger"></a>Workflow/Job
Trigger</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Trigger workflows and jobs when content changes.</p>
<h4><a name="Higherlevelobservationservices-Typicaluses"></a>Typical uses</h4>
<p>The unix print queue system is a good example, with folders named <em>incoming</em>,
<em>printing</em>, <em>done</em>, <em>rejected</em> that
store print job definitions.</p>
<h4><a name="Higherlevelobservationservices-Trigger"></a>Trigger</h4>
<p>Detection of new content items in the <em>incoming</em> folder(s).</p>
<h4><a name="Higherlevelobservationservices-Action"></a>Action</h4>
<p>Execute the corresponding tasks and move the message nodes according to the results.</p>
<h4><a name="Higherlevelobservationservices-Frequency"></a>Frequency</h4>
<p>Depends on the application.</p>
<h4><a name="Higherlevelobservationservices-Performance"></a>Performance</h4>
<p>Depends on the application.</p>
<h4><a name="Higherlevelobservationservices-Potentialissues"></a>Potential
issues</h4>
<p>Locking must be used if several job processors are competing for <em>incoming</em>
jobs.</p>

<p>Distributed processing of those jobs introduces cluster management requirements.</p></div>

<h2><a name="Higherlevelobservationservices-MessageQueue"></a>Message Queue</h2>
<div class="deflist"><h4><a name="Higherlevelobservationservices-Scenario"></a>Scenario</h4>
<p>Implement a simple message queue backed by a content repository subtree.</p></div>

<p>This is very similar to the Workflow/Job trigger use case: messages are exchanged
between producers and consumers.</p>
    </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/SLING/Higher+level+observation+services">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=31820405&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SLING/Higher+level+observation+services?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message