2
votes

Is there a way to find out when the last time spring integration successfully checked for messages? Specifically, the last time it ran, without error, regardless of whether it found content that it could turn into a message?

I have a mail inbound channel adapter (with a poller) connected to a router that spits the messages out to various channels.

1

1 Answers

2
votes

The actual polling logic is encapsulated with the internal Callable<Boolean> pollingTask implementation in the AbstractPollingEndpoint:

Callable<Boolean> pollingTask = new Callable<Boolean>() {
    @Override
    public Boolean call() throws Exception {
        return doPoll();
    }
};

where the boolean return means that we have extracted and sent a message or not.

This pollingTask can be wrapped with the AOP adviceChain meaning that we can intercept that doPoll() method. Therefore it is a place where your can track last time spring integration successfully checked for messages.

Consider implement the org.aopalliance.intercept.MethodInterceptor.