Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10454

Unclear piece in IdempotentConsumer.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.17.4, 2.18.1, 2.19.0
    • camel-core
    • None
    • Novice

    Description

      Current implementation of IdempotentConsumer.java has very strange check on whether IdempotentRepository contains the key - if it's ExchangeIdempotentRepository then the result of "contains()" check is not inverted(i.e. there is no NOT operator), while for other types of IdempotentRepository it IS inverted with "!".

      // check if we already have the key
      if (idempotentRepository instanceof ExchangeIdempotentRepository)

      { newKey = ((ExchangeIdempotentRepository<String>) idempotentRepository).contains(exchange, messageId); }

      else

      { newKey = !idempotentRepository.contains(messageId); }

      Attachments

        Issue Links

          Activity

            People

              acosentino Andrea Cosentino
              highel Boris Treukhov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: