You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cs...@apache.org on 2020/04/16 12:34:42 UTC

[sling-org-apache-sling-distribution-journal] branch master updated: SLING-9377 - Ignore test messages

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

cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git


The following commit(s) were added to refs/heads/master by this push:
     new a6a5e80  SLING-9377 - Ignore test messages
a6a5e80 is described below

commit a6a5e801402ef405a30d1255f043c527f8c1beb4
Author: Christian Schneider <cs...@adobe.com>
AuthorDate: Thu Apr 16 14:34:30 2020 +0200

    SLING-9377 - Ignore test messages
---
 .../sling/distribution/journal/impl/queue/impl/RangePoller.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/journal/impl/queue/impl/RangePoller.java b/src/main/java/org/apache/sling/distribution/journal/impl/queue/impl/RangePoller.java
index a60b9c3..51ceb7b 100644
--- a/src/main/java/org/apache/sling/distribution/journal/impl/queue/impl/RangePoller.java
+++ b/src/main/java/org/apache/sling/distribution/journal/impl/queue/impl/RangePoller.java
@@ -80,11 +80,14 @@ public class RangePoller {
     private void handlePackage(MessageInfo info, Messages.PackageMessage message) {
         long offset = info.getOffset();
         LOG.debug("Reading offset {}", offset);
-        if (offset < maxOffset) {
+        if (offset < maxOffset && isNotTestMessage(message)) {
             messages.add(new FullMessage<>(info, message));
         } else {
             fetched.countDown();
         }
     }
-
+    
+    private boolean isNotTestMessage(PackageMessage message) {
+        return message.getReqType() != PackageMessage.ReqType.TEST;
+    }
 }