I'm using a stateless session bean in a JBOSS server that performs an operation on an external system. The problem is that sometimes this system is collapsed an sends me the response after various minutes.

My idea is to tell the EJB method to answer with a timeout exception or whatever when the operation lasts more than, lets put, 3 seconds.