custom transport handler in AEM 6.0 | Community
Skip to main content
aem_dev1
Level 3
October 16, 2015
Solved

custom transport handler in AEM 6.0

  • October 16, 2015
  • 6 replies
  • 1659 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by gopalKa

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.

6 replies

smacdonald2008
Level 10
October 16, 2015

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. 

gopalKaAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.

aem_dev1
aem_dev1Author
Level 3
October 16, 2015

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

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

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

aem_dev1
aem_dev1Author
Level 3
October 16, 2015

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?

Sham_HC
Level 10
October 16, 2015

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,