15

Publishing Service is very new and while moving through various parts, I had a couple of questions.

The way we know it know is that the PublishItem Pipeline prior to Publishing Service will not have any effect, after installing Sitecore Publishing Service.

  1. In the current situation, can we customize some Pipeline in Sitecore Publishing Service?
  2. If yes, say I have a custom Processor in PublishItemProcessor - for some additional logging and hence I have written it below UpdateStatistics in current scenario - where will that go moving forward with Publishing Service?
19

You are correct .. none of the old publishing pipelines are called when the new service is installed.

Background

Traditionally, Sitecore publishes one item at a time. This is inefficient at a larger scale so the Publishing Service, instead, processes items in batches.

This means the existing pipelines are no longer conceptually compatible so there needed to be a 'batched' way of accessing the changes generated from a publish operation.

At the end of a publish, the Publishing Service will push all 'manifest results' (i.e changes that have just have just published) in batches to a pipeline.

The args object of this pipeline contains all items have that been created / updated / deleted during the publish process but before the caches have been cleared.

So if you need to check that certain types of item have been published or need to log anything extra or make any other changes then this pipeline is the place to do it.

Sitecore handles the batching and loading for you, you just process the batches as part of the pipeline arguments.

Details

The pipeline you need to look at the PublishBatchResult pipeline (found as part of the Sitecore Module in App_Config\Include\Sitecore.Publishing.Service.config - rather than the Publishing Service itself).

From the config:

This pipeline is called from publishingservice:publishend event handler which subscribes to the publish end event. Publish results will be passed to this pipeline in batches. The size of the batch is defined by 'manifestResultLoadBatchSize' parameter specified within the publishingservice:publishend configuration section.

If you create a processor in here you will receive a PublishEndResultBatchArgs object which will contain a batch of ManifestOperationResult<ItemResult> objects from which you can interrogate and some other helpful properties.

As mentioned, you can adjust the size of these batches in the config.

Sitecore uses this pipeline to issue the events that clear the caches on the CD servers .. so putting your processor before this means your processor will get called before the cache clear, afterwards is gets called after the cache clear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.