You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/01/13 09:35:00 UTC

[camel] branch master updated: CAMEL-14390: Move AsyncCallback.done to finally block

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new d149cb5  CAMEL-14390: Move AsyncCallback.done to finally block
d149cb5 is described below

commit d149cb567488890590d455e01529120cd16ab895
Author: James Netherton <ja...@gmail.com>
AuthorDate: Mon Jan 13 09:34:15 2020 +0000

    CAMEL-14390: Move AsyncCallback.done to finally block
---
 .../main/java/org/apache/camel/websocket/jsr356/JSR356Producer.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-websocket-jsr356/src/main/java/org/apache/camel/websocket/jsr356/JSR356Producer.java b/components/camel-websocket-jsr356/src/main/java/org/apache/camel/websocket/jsr356/JSR356Producer.java
index 1a8b1d0..f74361c 100644
--- a/components/camel-websocket-jsr356/src/main/java/org/apache/camel/websocket/jsr356/JSR356Producer.java
+++ b/components/camel-websocket-jsr356/src/main/java/org/apache/camel/websocket/jsr356/JSR356Producer.java
@@ -74,9 +74,10 @@ public class JSR356Producer extends DefaultAsyncProducer {
     private void doSend(final Exchange exchange, final AsyncCallback callback, final Session session) {
         try {
             JSR356WebSocketComponent.sendMessage(session, exchange.getIn().getBody());
-            callback.done(true);
         } catch (final IOException e) {
             exchange.setException(e);
+        } finally {
+            callback.done(true);
         }
     }