Expand my Community achievements bar.

SOLVED

custom transport handler

Avatar

Level 3

Hi,

I have created custom transport handler in AEM 6.0 by implementing Transporthandler


@Component(immediate = true, metatype = false)
@Service(TransportHandler.class)

When i replicate something, my custom transport handler is not invoked. How can do I force CQ to use our custom TransportHandler implementation instead of the standard one ?

1 Accepted Solution

Avatar

Correct answer by
Level 10

You are essentially writing a new service for AEM.  You have to tell AEM to use this service. YOu can use service ranking:

Service Ranking
OSGi Framework Service Ranking value is used to indicate the order used for calling this service. This is an int value where higher values designate higher precedence. 
Default value is 0.

https://docs.adobe.com/docs/en/cq/5-6-1/deploying/osgi_configuration_settings.html

View solution in original post

8 Replies

Avatar

Employee

Can you post your full source code?

If you follow the link provided by Scott, you will see a link to https://forums.adobe.com/message/4785913 which explains how to implement this. 

Regards,

Opkar

Avatar

Level 10

here is the article that talks about custom handler:

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

have you implemented those two methods?

Avatar

Level 3

I have implemented both the methods, but still my custom class is not invoked

Avatar

Level 10

Did you configure AEM to use your custom one? 

Avatar

Level 3

What configurations we need to in AEM to use custom transport handler? Documentation didnt say anything about it. Even i cannot provide ranking.

Avatar

Correct answer by
Level 10

You are essentially writing a new service for AEM.  You have to tell AEM to use this service. YOu can use service ranking:

Service Ranking
OSGi Framework Service Ranking value is used to indicate the order used for calling this service. This is an int value where higher values designate higher precedence. 
Default value is 0.

https://docs.adobe.com/docs/en/cq/5-6-1/deploying/osgi_configuration_settings.html

Avatar

Level 3

Hi Scott,

As suggested, added the service ranking(1000) for my custom transport handler, but still no luck. It is not being called. OOTB transport handler is called(com.day.cq.replication.impl.transport.Http). even OOTB doesnt have service ranking.