Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Invoke Replication Agent Using http request

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

23-10-2018

Hi,

I have custom replication agent with transport handler to invoke some REST API.

From AEM when I Activate/Deactivate any page - things work well.

Issue:

I want to invoke the replication agent/transport handler on author instance from a HTTP request from postman. is that possible?

My goal is to perform a performance run with that HTTP request.

Different trails made:

http://localhost:4502/etc/replication/agents.author/solragent.test.html  -> this would only work on GET and only path is /content

http://localhost:4502/bin/replication.json -> 403 Forbidden

We are using AEM 6.3

Is this possible?

Any pointers would greatly help.

Replies

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

216 likes

Total Posts

272 posts

Correct Reply

65 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

216 likes

Total Posts

272 posts

Correct Reply

65 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
Shashi_Mulugu
MVP

24-10-2018

Disable all other replication agents, enable only your custom agent and either use the curl command or Post man with below options.

curl -u admin:admin -X POST -F path="/content/path/to/page" -F cmd="activate" http://localhost:4502/bin/replicate.json

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

24-10-2018

Hi,

That is still giving Authentication failure issue. Though admin/admin is the correct credentials to be used.postmanIssue.jpg

Avatar

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile
Nirmal_Jose
MVP

24-10-2018

Have you setup basic authentication itself in the authentication tab. After setting that one, it worked for me

Screenshot 2018-10-25 at 08.52.26.png

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

25-10-2018

yes I did set it up.

I had to make 2 changes oin osgi

1. disable csrf for post request

2. Apache Sling Referrer Filter

Once I did these 2 then it started working. Did you make these changes?

How to make a simple HTTP POST request to AEM with a HTTP Rest Client, Postman - Sourced Code

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

25-10-2018

But the other most important problem. Even though I am getting 200, the replication agent- Transport handler is not getting invoked.

What am I missing?

I have the replication agent upo and working

Bundle for Transport handler is there.

Path and cmd params are passed.

I am getting 200

Is there any other URI I need to hit?

Avatar

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile
Nirmal_Jose
MVP

25-10-2018

I was able to do without doing both the changes, I am using vanilla 6.4

Avatar

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile
Nirmal_Jose
MVP

25-10-2018

Strange, I am getting a proper replication request on the default agent in author for each request in postman

http://localhost:4502/etc/replication/agents.author/publish.log.html#end

Are you trying to invoke a custom replication agent ?