ARTEMIS-1633 proper initialize route result

This commit is contained in:
Clebert Suconic 2018-01-25 12:10:58 -05:00
parent 37cc1e3e7a
commit 24b1f2efbc
1 changed files with 3 additions and 3 deletions

View File

@ -752,7 +752,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
boolean rejectDuplicates,
final Binding bindingMove) throws Exception {
RoutingStatus result = RoutingStatus.OK;
RoutingStatus result;
// Sanity check
if (message.getRefCount() > 0) {
throw new IllegalStateException("Message cannot be routed more than once");
@ -842,6 +842,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
}
}
} else {
result = RoutingStatus.OK;
try {
processRoute(message, context, direct);
} catch (ActiveMQAddressFullException e) {
@ -858,8 +859,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
context.getTransaction().commit();
}
final RoutingStatus finalResult = result;
server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> plugin.afterMessageRoute(message, context, direct, rejectDuplicates, finalResult) : null);
server.callBrokerPlugins(server.hasBrokerPlugins() ? plugin -> plugin.afterMessageRoute(message, context, direct, rejectDuplicates, result) : null);
return result;
}