Hey there, I found out what the problem was... and I am not sure what to say about it. Aparently, If I run my sample application using the command line and Maven: mvn exec:java -Dexec.mainClass="servers.MyApp_B", everything works as it is supposed to be.
However, if I do this in Eclipse IDE, when I press the *Terminate* button in the Eclipse console, the doStop() method is not called. I always assumed that pressing the *Terminate* button in the Eclipse console was the equivalent of pressing CTRL+C on a normal console, however, it appears that Eclipse simply kills the process (thus the reason why the doStop() and beforeStop() methods were not working !) I have to say I was not expecting some this ... /trivial/ to be the problem. Turns out I cannot use the Eclipse IDE to test my sample programs because of this issue. Who would have said? I guess we learn something new every day. Thanks for the help! I also created a thread in the Eclipse forums to check if there is a solution to the problem: http://www.eclipse.org/forums/index.php/m/1176961/#msg_1176961 Hopefully it will be useful to someone. -- View this message in context: http://camel.465427.n5.nabble.com/Is-there-a-way-to-send-a-message-when-I-am-terminating-tp5742834p5742885.html Sent from the Camel - Users mailing list archive at Nabble.com.
