Domanda

E.g. I want to call the @Asynchronous fire-and-forget method of service. Are there any guarantees of "firing" of this method? What will happen e.g. when server is stopped before actual firing of @Asynchronous method? Will it be fired on the next start of application? Is it possible to use other than the thread-pool implementation of @Asynchronous? Can it act as JMS queue (in persistent way)? Should I use JMS for persistence?

Seems that we can't use @Asynchronous in any reliable system, because it doesn't provide guarantee of firing...

P.S. One possible option is to use persistent Timer's to make deferred calls. Is it good idea?

È stato utile?

Soluzione

There are no transactional or persistence guarantees for @Asynchronous methods. I agree that this makes fire-and-forget methods very limited. I do think persistent timers are a reasonable alternative for asynchronously executing work if you need to guarantee it will run.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top