Skip to content
Snippets Groups Projects
Commit f16b70b3 authored by Falucho's avatar Falucho
Browse files

AutoCLose

parent f0a5c611
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import uy.edu.fing.tse.central.business.BusinessLocal;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.EJB;
import javax.ejb.Singleton;
import javax.ejb.Startup;
......@@ -79,4 +80,13 @@ public class MessageConsumer {
}
});
}
@PreDestroy
public void stop() {
try {
channel.close();
} catch (IOException | TimeoutException e) {
throw new RuntimeException("Error al cerrar la coneccion con MQ", e);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment