org.camunda.bpm.extension.reactor.projectreactor.selector.UriPathTemplate#matcher caches matchers for a uriPattern. However, java.util.regex.Matcher is not thread safe as it has an internal state that is changed during java.util.regex.Matcher#matches.
Under heavy load that caused a loss of events in our environment.
I don't see the need to cache the Matcher. The expensive operation when creating a new Matcher is the compilation of the java.util.regex.Pattern. This is only done once per pattern anyway which is ensured here: java.util.regex.Pattern#matcher.
org.camunda.bpm.extension.reactor.projectreactor.selector.UriPathTemplate#matcher
caches matchers for auriPattern
. However,java.util.regex.Matcher
is not thread safe as it has an internal state that is changed duringjava.util.regex.Matcher#matches
.Under heavy load that caused a loss of events in our environment.
I don't see the need to cache the Matcher. The expensive operation when creating a new Matcher is the compilation of the
java.util.regex.Pattern
. This is only done once per pattern anyway which is ensured here:java.util.regex.Pattern#matcher
.