From 056920e6ab86c21b2701e32a7e6c4bfb1788ef92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 14 Sep 2016 15:32:21 +0300 Subject: [PATCH] Don't generate unnecessary ID's on divert --- .../apache/activemq/artemis/core/server/impl/DivertImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java index 4316a9864a..ad24a44e3f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java @@ -83,12 +83,11 @@ public class DivertImpl implements Divert { logger.trace("Diverting message " + message + " into " + this); } - long id = storageManager.generateID(); - ServerMessage copy = null; // Shouldn't copy if it's not routed anywhere else if (!forwardAddress.equals(message.getAddress())) { + long id = storageManager.generateID(); copy = message.copy(id); // This will set the original MessageId, and the original address