Expand my Community achievements bar.

SOLVED

custom transport handler in AEM 6.0

Avatar

Level 3

Hi,

I want to override the transport handler which will be used by replication agent in author instance for my custom logic. My publish instance is in tomcat which requires an authentication to handle the request. I want to send authentication info through custom transport handler. I found the below link.

http://www.intelligrape.com/blog/custom-transport-handler-in-cq5aem/ 

Can anyone share the sample logic?

1 Accepted Solution

Avatar

Correct answer by
Employee

Do you want to just sent some authentication headers? A typical transporthandler will need two methods. 

1. canhandle --

2.deliver. -- here you get your content, and use httpclient to push the content to whichever server you want.

having said that, OOB handler is enough for you to send any extra headers you want. Please have a look at the extended tab in the replication agent.

View solution in original post

6 Replies

Avatar

Level 10

Some community articles leave the details out for some reason.

A working example is better than no example at all. I am not aware of internal Adobe community articles that show this code. I will look for some examples areound this use case. 

Avatar

Correct answer by
Employee

Do you want to just sent some authentication headers? A typical transporthandler will need two methods. 

1. canhandle --

2.deliver. -- here you get your content, and use httpclient to push the content to whichever server you want.

having said that, OOB handler is enough for you to send any extra headers you want. Please have a look at the extended tab in the replication agent.

Avatar

Level 3

I will have to read a cookie from browser and want to send that as request header. To do that we need to create transport handler. Please share the sample code if available to create the custom transport handler

Avatar

Employee Advisor

Hi,

what cookie do you want to add to the transport handler? There is no browser involved in the replication process. Can you please elaborate?

kind regards,
Jörg

Avatar

Level 3

My bad. By mistake i said browser in my previous post. Basically i will get security token from some other service which i want to send as part of replication request. If i want to create custom transport handler, i will have to implement Transport Handler interface provided. But if i implement my own transport handler, i have to code everything that adobe provides as OOTB functionality and add custom header to request. Is there any way that we can extend existing transport handler, and want to supply additional request headers?

Avatar

Level 10

AEM dev wrote...

My bad. By mistake i said browser in my previous post. Basically i will get security token from some other service which i want to send as part of replication request. If i want to create custom transport handler, i will have to implement Transport Handler interface provided. But if i implement my own transport handler, i have to code everything that adobe provides as OOTB functionality and add custom header to request. Is there any way that we can extend existing transport handler, and want to supply additional request headers?

 


In the replication agent at extended tab you can pass additional headers,