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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Custom TransportHandler not called

sumitc22
Level 4
Level 4

Hi All,

The custom TransportHandler is not called when I am publishing a page. How to fix it ?Please find the source code.I'm using AEM 6.1.

I read one thread where it is mentioned that service ranking needs to be set higher.But the link provided does not have enough details.

__________________________________________

import java.util.List;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.day.cq.replication.AgentConfig;
import com.day.cq.replication.ReplicationContent;
import com.day.cq.replication.ReplicationContentFactory;
import com.day.cq.replication.ReplicationException;
import com.day.cq.replication.ReplicationResult;
import com.day.cq.replication.ReplicationTransaction;
import com.day.cq.replication.TransportContext;
import com.day.cq.replication.TransportHandler;

@Service(TransportHandler.class)
@Component(label = "My Transport Handler", immediate = true, metatype = false,enabled = true)
public class CustomTransportHandler implements TransportHandler {
    
    Logger log = LoggerFactory.getLogger(this.getClass());

    public boolean canHandle(AgentConfig arg0) {
        log.info("Canhandle...");
        return true;
    }

    public ReplicationResult deliver(TransportContext arg0,
            ReplicationTransaction arg1) throws ReplicationException {
        log.info("deliver....");
        return null;
    }

    public ReplicationResult poll(TransportContext arg0,
            ReplicationTransaction arg1, List<ReplicationContent> arg2,
            ReplicationContentFactory arg3) throws ReplicationException {
        // TODO Auto-generated method stub
        return null;
    }
 
}

1 Accepted Solution
Tuhin_Ghosh
Correct answer by
Level 7
Level 7

You need to mention service ranking for your transport handler to get preference. 

View solution in original post

2 Replies
Herbal_Care_Pro
Level 1
Level 1

Epididymitis Treatment by Herbal Care Products

Epididymitis natural herbal treatment also symptoms and causes define by herbal care products. Epdiical is the treatment product. You get that from our online store.

For Treatment Visit Here :  www.herbal-care-products.com/epididymitis

Tuhin_Ghosh
Correct answer by
Level 7
Level 7

You need to mention service ranking for your transport handler to get preference. 

View solution in original post