As far as I understand in Spring integration the schedule period does for:
- a Channel Adapter polls from an endpoint (MessageSource) and pulls the messages to the channel
- a Channel Adapter polls from a channel and pulls the messages to an endpoint (MessageTarget)
The latter is equivalent to the Service Activator (polls from the input channel) and GatewayProxyFactoryBean (polls from the request channel).
In my case I have implemented my own RMI endpoint. The configuration looks as followed:
Here messages from the request channel are send to the RMIEndpoint. There is no need for the Service Activator to poll from the request channel. Responses from the endpoint are send to the reply channel.
<beans:property name="agentId" value="railroad.agent.name" />
Since I do not know whether the remote object is already registered to the RMI registry I would like to push/resend messages under these conditions:
- schedule period: the time (e.g. after 1000millis) when to call the endpoint again after a failure
- timeout: the time (e.g. after 5000 millis) when to stop calling the endpoint after a failure
NOW THE QUESTION:
How should I implement this? I took a brief look at the M5 sources and wonder whether I can use the PollingDispatcher and Schedule for my endpoint?!
The idea of re-calling the endpoint allows the two parties (producer/consumer) not to direclty rely on each other and let the messaging system take care of this. Isn't that one of the biggest advantage of a loosely coupled system as mentioned in EIP?