[ 
https://issues.apache.org/jira/browse/SLING-10384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17352438#comment-17352438
 ] 

Timothee Maret commented on SLING-10384:
----------------------------------------

I am concerned with using events to intercept package processing after the 
package import commit. 

Events are not guaranteed to be delivered which fall short for use case that 
require exactly once or at least once processing. 

Also events don't restrict who can add a hook and open the feature to any 
component, from platform or customer code. Do we really need this or could we 
identify use cases that require that feature and only support those ? Assuming 
not, we may use a required service reference instead of relying on events. 

Another point is about observability. Those hooks could be written poorly or 
require considerable work. 
 Since those hooks would be executed in sync with the package processing, the 
distribution end to end latency will be negatively impacted. We'd need to add a 
new latency metric that covers only the processing of the hooks such that we 
can more easily pin point the culprit in case distribution throughput drops or 
latency increases.   

> Execute actions before sending "o/a/s/d/i/package/imported" event
> -----------------------------------------------------------------
>
>                 Key: SLING-10384
>                 URL: https://issues.apache.org/jira/browse/SLING-10384
>             Project: Sling
>          Issue Type: New Feature
>          Components: Content Distribution
>    Affects Versions: Content Distribution Journal Core 0.1.16
>            Reporter: Joerg Hoh
>            Assignee: Joerg Hoh
>            Priority: Major
>             Fix For: Content Distribution Journal Core 0.1.18, Content 
> Distribution API 0.5.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> After the package has been imported and before the event 
> "org/apache/sling/distribution/importer/package/imported" event is sent, 
> custom functionality should be executed synchronously. It should have access 
> to the same type of information which is sent with the event.
> This allows to execute actions which before any handlers of the "imported" 
> event.
> On the implementation side we will do a {{eventadmin.sendEvent()}} and add 
> the same payload as with the "package/imported" event, but under the topic 
> {{o/a/s/d/i/package/committed}} . This will allow the synchronous executions 
> of event handlers.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to