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

Timothee Maret commented on SLING-10564:
----------------------------------------

The offset is available in the PubQueueCache#merge and needs to be returned via 
the [sendAndWait 
call|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/c9332df9e3ad03d8f2bedf4fea0f4715f71479af/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java#L306].

I see two ways to pass the offset from the cache to the DistributionPublisher 
agent
 * (a) Add the offset in the org/apache/sling/distribution/agent/package/queued 
event and have the PackageQueuedNotifier return the offset.
 * (b) Pass a callback in the PubQueueCache that is executed upon merging. The 
callback implementation would cover sending the event and unblock the 
PackageQueuedNotifier.

The option (a) is the simplest but it extends the API surface by leaking the 
offset in the OSGi events and it's also prove loosing events in edge cases 
where packages are distributed before the event handler is subscribed. The 
option (b) is more reliable and does not extend the API suface.

> Log package offset in the Distribution Publisher
> ------------------------------------------------
>
>                 Key: SLING-10564
>                 URL: https://issues.apache.org/jira/browse/SLING-10564
>             Project: Sling
>          Issue Type: Improvement
>          Components: Content Distribution
>            Reporter: Timothee Maret
>            Assignee: Timothee Maret
>            Priority: Major
>             Fix For: Content Distribution Journal Core 0.1.18
>
>
> As pointed out in SLING-10527, we currently don't log the package offset in 
> the DistributionPublisher. We should log it.



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

Reply via email to