You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/04/06 05:08:01 UTC
[camel] branch camel-3.x updated: CAMEL-19180 - Kafka Idempotent Repository does not give the user control over a randomized group id if the kafka broker requires the id to be in a specified form
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push:
new b7b13d5a1a9 CAMEL-19180 - Kafka Idempotent Repository does not give the user control over a randomized group id if the kafka broker requires the id to be in a specified form
b7b13d5a1a9 is described below
commit b7b13d5a1a9b78bbb5ca6a329d659ea6c3b16a37
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 6 07:07:44 2023 +0200
CAMEL-19180 - Kafka Idempotent Repository does not give the user control over a randomized group id if the kafka broker requires the id to be in a specified form
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../KafkaConsumerIdempotentGroupIdIT.java | 81 ----------------------
1 file changed, 81 deletions(-)
diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentGroupIdIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentGroupIdIT.java
deleted file mode 100644
index 7d3f7f16a8d..00000000000
--- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerIdempotentGroupIdIT.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.kafka.integration;
-
-import java.util.Arrays;
-
-import org.apache.camel.BindToRegistry;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.kafka.integration.common.KafkaTestUtil;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.idempotent.kafka.KafkaIdempotentRepository;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
-
-import static org.apache.camel.component.kafka.serde.KafkaSerdeHelper.numericHeader;
-
-@DisabledIfSystemProperty(named = "enable.kafka.consumer.idempotency.tests", matches = "false")
-public class KafkaConsumerIdempotentGroupIdIT extends KafkaConsumerIdempotentTestSupport {
-
- public static final String TOPIC = "idempt";
-
- private int size = 200;
-
- @BindToRegistry("kafkaIdempotentRepository")
- private KafkaIdempotentRepository testIdempotent
- = new KafkaIdempotentRepository("TEST_IDEMPOTENT", getBootstrapServers(), "test_1");
-
- @BeforeEach
- public void before() {
- kafkaAdminClient.deleteTopics(Arrays.asList(TOPIC, "TEST_IDEMPOTENT")).all();
- doSend(size, TOPIC);
- }
-
- @AfterEach
- public void after() {
- kafkaAdminClient.deleteTopics(Arrays.asList(TOPIC, "TEST_IDEMPOTENT")).all();
- }
-
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
-
- @Override
- public void configure() {
- from("kafka:" + TOPIC
- + "?groupId=KafkaConsumerIdempotentIT&autoOffsetReset=earliest"
- + "&keyDeserializer=org.apache.kafka.common.serialization.StringDeserializer"
- + "&valueDeserializer=org.apache.kafka.common.serialization.StringDeserializer"
- + "&autoCommitIntervalMs=1000&pollTimeoutMs=1000&autoCommitEnable=true"
- + "&interceptorClasses=org.apache.camel.component.kafka.MockConsumerInterceptor").routeId("foo")
- .idempotentConsumer(numericHeader("id"))
- .idempotentRepository("kafkaIdempotentRepository")
- .to(KafkaTestUtil.MOCK_RESULT);
- }
- };
- }
-
- @Test
- @DisplayName("Numeric headers is consumable when using idempotent (CAMEL-16914)")
- void kafkaIdempotentMessageIsConsumedByCamel() {
- MockEndpoint to = contextExtension.getMockEndpoint(KafkaTestUtil.MOCK_RESULT);
-
- doRun(to, size);
- }
-}