MimerPlusPlus commented on code in PR #22114:
URL: https://github.com/apache/camel/pull/22114#discussion_r3141759357
##########
components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomComponent.java:
##########
@@ -31,12 +32,34 @@
@Component("atom")
public class AtomComponent extends FeedComponent {
+ private static final String KEY_FORMAT_IDEMPOTENT_PARAM = "idempotent";
+ private static final String KEY_FORMAT_STRATEGY_PARAM =
"idempotentStrategy";
+ private static final String KEY_FORMAT_IDEMPOTENT_REPOSITORY_PARAM =
"idempotentRepository";
+
public AtomComponent() {
}
@Override
protected FeedEndpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
- return new AtomEndpoint(uri, this, null);
+ AtomEndpoint endpoint = new AtomEndpoint(uri, this, null);
+ // Setup idempotency
+ endpoint.setIdempotent(getAndRemoveParameter(parameters,
KEY_FORMAT_IDEMPOTENT_PARAM, Boolean.class, true));
+ if (endpoint.isIdempotent()) {
+ endpoint.setIdempotentRepository(
+ resolveAndRemoveReferenceParameter(parameters,
KEY_FORMAT_IDEMPOTENT_REPOSITORY_PARAM,
+ IdempotentRepository.class));
+ String idempotentStrategy = getAndRemoveParameter(parameters,
KEY_FORMAT_STRATEGY_PARAM, String.class);
+ AtomIdempotentStrategy atomIdempotentStrategy
+ = resolveEnumIdempotentStrategy(idempotentStrategy,
endpoint.getIdempotentRepository());
+ if (atomIdempotentStrategy != null) {
+ parameters.put(KEY_FORMAT_STRATEGY_PARAM,
atomIdempotentStrategy);
+ } else if (idempotentStrategy != null) {
+ // its not a standard, but a reference - fallback to
AtomEndpointConfigurator
+ parameters.put(KEY_FORMAT_STRATEGY_PARAM, idempotentStrategy);
+
//endpoint.setIdempotentStrategy(resolveAndRemoveReferenceParameter(parameters,
KEY_FORMAT_STRATEGY_PARAM, AtomIdempotentStrategy.class));
Review Comment:
@davsclaus Sorry, I tried to fix it by removing the commented out line, but
my fork had moved a bit too far from my fork to just push the change - i'll do
it tomorrow or monday :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]