Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Issues setting up Distribution Agent

Avatar

Level 2

My use-case is :
1. Setup a custom distribution agent
2. On modify, add, delete etc JCR events the agent will get triggered. [This I will be able to achieve via JCREventDistributionTriggerFactory once the Distribution Agent config is setup correctly].
3. I do not have a publish instance so my requirement is the agent will parse the path and then post the data to a servlet which in turn should be fetched somehow and the data that was posted needs to be printed in the error.log as of now.

I tried setting up the distribution agent but I am not sure how to do it accurately when I don't have publisher. 

The Settings tab keeps showing error. Can someone help me with the configuration setup for the distribution agent? (org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-my-agent.cfg.json is what I tried using - it does create the agent but it does not work).

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Community Advisor

Hi @ArindamCh,

You can give this a try - it should work even without a publish instance.

Since you just want the agent to send data to a servlet instead of a publish instance, you can use a Forward Distribution Agent and point it directly to your servlet URL.

Here’s a sample config you can start with (org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-my-agent.cfg.json

{
  "name": "my-agent",
  "enabled": true,
  "queue.processing.enabled": true,
  "allowed.roots": ["/content"],
  "packageImporter.endpoints": ["http://localhost:4502/bin/my-distribution-servlet"],
  "requestAuthorizationStrategy.target": "(name=default)",
  "transportSecretProvider.target": "(name=default)"
}

Then, add a trigger using JcrEventDistributionTriggerFactory so the agent fires on add/modify/delete events:

{
  "path": "/content",
  "deep": true
}

Once this is set up, try making a content change - the agent should send a POST request to your servlet.
You can log whatever you receive there into error.log just to confirm the data flow.

If you still see an error under the “Settings” tab, it usually means one of the references (like packageBuilder or requestAuthorizationStrategy) isn’t resolving properly - you can check that under /system/console/components and make sure the dependencies are active.

 


Santosh Sai

AEM BlogsLinkedIn