Skip to main content
Level 1
October 13, 2026
Question

In AEM as a cloud service Custom TransformerFactory is active in publish, but createTransformer() is never called.

What exactly causes a custom Sling HTML rewriter pipeline to be selected in AEMaaCS publish, and are there Cloud-specific cases where page HTML bypasses the rewriter chain?

 

Pipeline config: /apps/<folder>/config/rewriter/<pipeline> in ui.apps

Transformer type: sample-transformer

Symptoms: OSGi registration OK, config OK, but no request-time custom transformer logs

1 reply

Level 2
October 14, 2026

​@purusotham ,

Short version: the pipeline with the highest order wins, and only one pipeline runs per response. There’s no Cloud-specific rewriter bypass. On AEMaaCS, missing transformer logs almost always mean the request never reached Publish.

Why your pipeline might not be getting picked

  • Sling takes the matching, enabled config with the highest order (default 0). Pipelines aren’t merged or chained.
  • OOTB configs under /libs have an order too. If one of them matches your request and ranks higher, your transformer never makes it into the chain. Compare your order against every matching entry on the Sling Rewriter status page.
  • Once your pipeline is selected, the default one doesn’t run. If you still need something from it, like linkchecker, add it to your own transformerTypes.
  • Each transformerTypes entry has to match your factory’s pipeline.type exactly. A registered factory only proves the component is active, not that a pipeline picks it up. If sample-transformer is off by even one character, the transformer is never created.

Quickest fix
I’d register the factory as a global transformer instead of using a pipeline config: pipeline.mode=global plus an integer service.ranking. Below 0 it runs right after the generator, and at 0 or above it runs just before the serializer. It gets added to whichever pipeline is selected, so there’s no order conflict to worry about.

The Cloud-specific cause: cached HTML
The rewriter only runs when Publish renders the page. Dispatcher is mainly there to take load off the publish nodes, and the CDN caches based on Cache-Control, Surrogate-Control and Expires. Once a page is cached, repeat requests never reach Sling, so you see no transformer logs.

To narrow it down, could you share:

  • The Publish logs for a request with a cache-busting query parameter appended, with your transformer’s logger at DEBUG.
  • Your rewriter node properties (order, paths, contentTypes, transformerTypes) and the factory’s pipeline.type.
  • Your use case: what the transformer changes in the HTML, and which pages or paths it should apply to. Depending on that, a global transformer may suit you better than a dedicated pipeline.
Translate