incrementCounter

Processor that increments the value of a uniquely identified counter set as an exchange property.

Properties

Name Summary

counterId

Required identifier of the counter exchange property to increment. The expected exchange property would be named counter.<counterId>. If such property does not exist, one with the expected name will be created and initialized with a value of 1. If the property does exist, but its value was not configured correctly (i.e., not an integer or the value is below 0), then processing will fail.

name

Optional, descriptive name for the processor.

id

Required identifier of the processor, unique across all processors within the flow. Must be between 3 and 30 characters long; contain only lower and uppercase alphabetical characters (a-z and A-Z), numbers, dashes ("-"), and underscores ("_"); and start with an alphabetical character. In other words, it adheres to the regex pattern [a-zA-Z][a-zA-Z0-9_-]{2,29}.

exchangeProperties

Optional set of custom properties in a simple jdk-format, that are added to the message exchange properties before processing the incoming payload. Any existing properties with the same name will be replaced by properties defined here.

retainPayloadOnFailure

Whether the incoming payload is available for error processing on failure. Defaults to false.

Sub-builders

Name Summary

messageLoggingStrategy

Strategy for describing how a processor’s message is logged on the server.

payloadArchivingStrategy

Strategy for archiving payloads.

inboundTransformationStrategy

Strategy that customizes the conversion of an incoming payload by a processor (e.g., string to object). Should be used when the processor’s default conversion logic cannot be used.

Details

Exchange Property

The incrementCounter processor increments the value of a specially designated exchange property. Counter-related exchange properties are prefixed with "counter.", available as the constant COUNTER_PREFIX. For example, if the counterId property is set to testCount, the expected exchange property would be counter.testCount. Its value would then increment by one.

However, be mindful of the following scenarios:

  • If the given exchange property is not found, one will be created and initialized with a value of 1.

  • If the given exchange property is found but was not configured with an integer value greater than zero, then processing will fail.