I'm developing an application which must download some files via HTTP/FTP. This is done by an MDB, which uses a specific client for the protocols (e.g. Java URLConnection, etc.). As this downloads are triggered periodically via JBoss TimerService I have a problem, if the connection hangs. Because in this case I get no Exception, the MDB will simply hang infinitely.
Is there any way to stop a running MDB instance from outside (at best automatically by JBoss)? Because I'm using the "@Pool"-annotation with "maxSize=5" to reduce the number of concurrent network connections, I'm out of available instances if some MDBs hang.
I've tried some ideas so far, but without success:
I'm using EJB3 on JBoss 5.1.0 AS.
Thanks in advance!