[rabbitmq-discuss] Improving our documentation
jiri at krutil.com
jiri at krutil.com
Tue Nov 23 10:29:59 GMT 2010
>> Btw, I guess the finally block in Recv won't get executed unless an
>> exception is thrown -- that means no clean shutdown is possible. But I
>> guess that's OK for a hello-world app.
>
> The finally block _always_ gets executed, whether the is an exception or
> not, so you get both clean shutdown, and shutdown in the case of an
> exception.
The finally block does not get executed if you stop the JVM.
The endless loop in Recv.main() can only end in two ways: exception or
JVM shutdown. I don't see a way how to perform a clean shutdown of the
receiver.
If the user stops the receiver by killing the Java process, the
connection will stay open on the broker and will have to time out. In
my opinion that's a reasource leak, which should not appear in a
tutorial.
Jiri
More information about the rabbitmq-discuss
mailing list