You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by "sandeep-mst (via GitHub)" <gi...@apache.org> on 2026/04/02 11:55:11 UTC
[PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
sandeep-mst opened a new pull request, #11:
URL: https://github.com/apache/pulsar-connectors/pull/11
<!-- Either this PR fixes an issue, -->
Fixes [#25450](https://github.com/apache/pulsar/pull/25452)
### Motivation
<!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
Fix acknowledgments not being sent when the `collapsePartitionedTopics=true` on kafka-connect-adapter. The topic name stored in [sinkrecord](https://github.com/apache/pulsar/blob/3d33e4874fefa2a570a1ef60e02d9e995c4dde27/pulsar-io/kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java#L443) and [currentOffsets](https://github.com/apache/pulsar/blob/3d33e4874fefa2a570a1ef60e02d9e995c4dde27/pulsar-io/kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java#L500) is different from the topic name stored in the pulsar record.
The topic name used in SinkRecord / currentOffsets is collapsed (base topic name) and the topic name in the original Pulsar Record remains non-collapsed (includes -partition-X)
As a result, during `ackUntil()`
- Topic lookup in committedOffsets fails
- [lastCommittedOffset](https://github.com/apache/pulsar/blob/3d33e4874fefa2a570a1ef60e02d9e995c4dde27/pulsar-io/kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java#L312) will always be `null` because of topic name mismatch.
- Records are never acknowledged
### Modifications
<!-- Describe the modifications you've done. -->
Updated `ackUntil()` to derive topic and partition from the source Record using the same logic as `toSinkRecord()` (i.e., respecting `collapsePartitionedTopics`)
Added a debug log and `ackRequestedCount` for better logging clarity.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- *org.apache.pulsar.io.kafka.connect.KafkaConnectSinkTest#testAckUntilWithCollapsePartitionedTopics*
- *org.apache.pulsar.io.kafka.connect.KafkaConnectSinkTest#testAckUntilWithoutCollapsePartitionedTopics*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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: dev-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#issuecomment-4286449898
@lhotari All the review comments have been resolved. Please review when possible.
Thanks and Regards
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3115641044
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -98,19 +98,11 @@ public class KafkaConnectSink implements Sink<GenericObject> {
// Thi is a workaround for https://github.com/apache/pulsar/issues/19922
private boolean collapsePartitionedTopics = false;
- private final Cache<String, String> sanitizedTopicCache =
- CacheBuilder.newBuilder().maximumSize(1000)
- .expireAfterAccess(30, TimeUnit.MINUTES).build();
-
- // Can't really safely expire these entries. If we do, we could end up with
- // a sanitized topic name that used in e.g. resume() after a long pause but can't be
- // // re-resolved into a form usable for Pulsar.
- private final Cache<String, String> desanitizedTopicCache =
- CacheBuilder.newBuilder().build();
-
private int maxBatchBitsForOffset = 12;
private boolean useIndexAsOffset = true;
+ TopicPartitionResolver topicPartitionResolver;
Review Comment:
done
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -391,6 +388,94 @@ static class BatchMessageSequenceRef {
int batchIdx;
}
+ @Getter
+ @AllArgsConstructor
+ static class ResolvedTopicPartition {
+ private final String topic;
+ private final int partition;
+ }
+
+ static class TopicPartitionResolver {
+ private final String topicName;
+ private final boolean sanitizeTopicName;
+ private final boolean collapsePartitionedTopics;
+ private final Cache<String, String> sanitizedTopicCache =
+ CacheBuilder.newBuilder().maximumSize(1000)
+ .expireAfterAccess(30, TimeUnit.MINUTES).build();
+
+ // Can't really safely expire these entries. If we do, we could end up with
+ // a sanitized topic name that used in e.g. resume() after a long pause but can't be
+ // // re-resolved into a form usable for Pulsar.
Review Comment:
done.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3115597248
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -98,19 +98,11 @@ public class KafkaConnectSink implements Sink<GenericObject> {
// Thi is a workaround for https://github.com/apache/pulsar/issues/19922
private boolean collapsePartitionedTopics = false;
- private final Cache<String, String> sanitizedTopicCache =
- CacheBuilder.newBuilder().maximumSize(1000)
- .expireAfterAccess(30, TimeUnit.MINUTES).build();
-
- // Can't really safely expire these entries. If we do, we could end up with
- // a sanitized topic name that used in e.g. resume() after a long pause but can't be
- // // re-resolved into a form usable for Pulsar.
- private final Cache<String, String> desanitizedTopicCache =
- CacheBuilder.newBuilder().build();
-
private int maxBatchBitsForOffset = 12;
private boolean useIndexAsOffset = true;
+ TopicPartitionResolver topicPartitionResolver;
Review Comment:
`topicPartitionResolver` is currently package-private and mutable, which makes it easy for other code in the package (or tests) to accidentally reassign/null it out. Consider making it `private final` (initialized in `open()`), and if tests need access to sanitization, expose a small `@VisibleForTesting` accessor/helper method instead of reaching into the field directly.
```suggestion
private TopicPartitionResolver topicPartitionResolver;
```
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -391,6 +388,94 @@ static class BatchMessageSequenceRef {
int batchIdx;
}
+ @Getter
+ @AllArgsConstructor
+ static class ResolvedTopicPartition {
+ private final String topic;
+ private final int partition;
+ }
+
+ static class TopicPartitionResolver {
+ private final String topicName;
+ private final boolean sanitizeTopicName;
+ private final boolean collapsePartitionedTopics;
+ private final Cache<String, String> sanitizedTopicCache =
+ CacheBuilder.newBuilder().maximumSize(1000)
+ .expireAfterAccess(30, TimeUnit.MINUTES).build();
+
+ // Can't really safely expire these entries. If we do, we could end up with
+ // a sanitized topic name that used in e.g. resume() after a long pause but can't be
+ // // re-resolved into a form usable for Pulsar.
Review Comment:
Minor grammar/typo in this comment (missing “is”) and an extra `//` that looks accidental; cleaning it up will improve readability.
```suggestion
// a sanitized topic name that is used in e.g. resume() after a long pause but can't be
// re-resolved into a form usable for Pulsar.
```
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3105380496
##########
kafka-connect-adaptor/src/test/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSinkTest.java:
##########
@@ -1682,6 +1682,67 @@ private void testCollapsePartitionedTopic(boolean isEnabled,
sink.close();
}
+ @Test
+ public void testAckUntilWithCollapsePartitionedTopics() throws Exception {
+ testAckUntil(true,
+ "persistent://a/b/fake-topic-partition-0",
+ "persistent://a/b/fake-topic",
+ 0);
+ }
+
+ @Test
+ public void testAckUntilWithoutCollapsePartitionedTopics() throws Exception {
+ // Note: Without collapsePartitionedTopics expectedPartition in the committedOffsets will always be 0
+ testAckUntil(false,
+ "persistent://a/b/fake-topic-partition-1",
+ "persistent://a/b/fake-topic-partition-1",
+ 0);
+ }
+
+ private void testAckUntil(boolean collapseEnabled,
+ String pulsarTopic,
+ String expectedKafkaTopic,
+ int expectedPartition) throws Exception {
+ // Setup sink with given collapseEnabled value
+ props.put("kafkaConnectorSinkClass", SchemaedFileStreamSinkConnector.class.getCanonicalName());
+ props.put("collapsePartitionedTopics", Boolean.toString(collapseEnabled));
+ KafkaConnectSink sink = new KafkaConnectSink();
+ sink.open(props, context);
+
+ // Create pulsar record with given pulsarTopic and expectedPartition
+ Message msg = mock(MessageImpl.class);
+ when(msg.getMessageId()).thenReturn(new MessageIdImpl(1, 1, expectedPartition));
+ when(msg.getValue()).thenReturn(null);
+
+ AtomicInteger ackCount = new AtomicInteger(0);
+
+ Record<GenericObject> record = PulsarRecord.<GenericObject>builder()
+ .topicName(pulsarTopic)
+ .message(msg)
+ .ackFunction(ackCount::incrementAndGet)
+ .failFunction(() -> {})
+ .build();
+
+ // Add the pulsar record to pendingFlushQueue
+ sink.pendingFlushQueue.add(record);
+
+ // Build committedOffsets with the given expectedKafkaTopic and expectedPartition
+ Map<TopicPartition, OffsetAndMetadata> committedOffsets = new HashMap<>();
+ committedOffsets.put(
+ new TopicPartition(expectedKafkaTopic, expectedPartition),
+ new OffsetAndMetadata(sink.getMessageOffset(record))
+ );
+
+ // Trigger actUntil manually
Review Comment:
done.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3105421656
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -300,9 +300,18 @@ protected void ackUntil(Record<GenericObject> lastNotFlushed,
partitionOffset.put(tp.partition(), e.getValue().offset());
}
+ int ackRequestedCount = 0;
for (Record<GenericObject> r : pendingFlushQueue) {
- final String topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
- final int partition = r.getPartitionIndex().orElse(0);
+ final String topic;
+ final int partition;
+ if (shouldCollapsePartitionedTopic(r)) {
Review Comment:
add a null guard with error log and retry
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#issuecomment-4180302837
@sandeep-mst Please rebase / merge latest master. I didn't have permission to do that for your PR branch.
```shell
❯ gh pr update-branch 11
GraphQL: user doesn't have permission to update head repository (updatePullRequestBranch)
```
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3030499510
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -300,9 +300,18 @@ protected void ackUntil(Record<GenericObject> lastNotFlushed,
partitionOffset.put(tp.partition(), e.getValue().offset());
}
+ int ackRequestedCount = 0;
for (Record<GenericObject> r : pendingFlushQueue) {
- final String topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
- final int partition = r.getPartitionIndex().orElse(0);
+ final String topic;
+ final int partition;
+ if (shouldCollapsePartitionedTopic(r)) {
Review Comment:
`ackUntil()` assumes `committedOffsets` is non-null, but `flush()` can call `ackUntil(lastNotFlushed, committedOffsets, Record::fail)` with `committedOffsets` still null if an exception occurs before `task.preCommit()` assigns it. This can cause a NullPointerException and leave records stuck in `pendingFlushQueue`. Add a null/empty guard (and decide how to handle fail/ack in that case) before iterating committedOffsets.
##########
kafka-connect-adaptor/src/test/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSinkTest.java:
##########
@@ -1682,6 +1682,67 @@ private void testCollapsePartitionedTopic(boolean isEnabled,
sink.close();
}
+ @Test
+ public void testAckUntilWithCollapsePartitionedTopics() throws Exception {
+ testAckUntil(true,
+ "persistent://a/b/fake-topic-partition-0",
+ "persistent://a/b/fake-topic",
+ 0);
+ }
+
+ @Test
+ public void testAckUntilWithoutCollapsePartitionedTopics() throws Exception {
+ // Note: Without collapsePartitionedTopics expectedPartition in the committedOffsets will always be 0
+ testAckUntil(false,
+ "persistent://a/b/fake-topic-partition-1",
+ "persistent://a/b/fake-topic-partition-1",
+ 0);
+ }
+
+ private void testAckUntil(boolean collapseEnabled,
+ String pulsarTopic,
+ String expectedKafkaTopic,
+ int expectedPartition) throws Exception {
+ // Setup sink with given collapseEnabled value
+ props.put("kafkaConnectorSinkClass", SchemaedFileStreamSinkConnector.class.getCanonicalName());
+ props.put("collapsePartitionedTopics", Boolean.toString(collapseEnabled));
+ KafkaConnectSink sink = new KafkaConnectSink();
+ sink.open(props, context);
+
+ // Create pulsar record with given pulsarTopic and expectedPartition
+ Message msg = mock(MessageImpl.class);
+ when(msg.getMessageId()).thenReturn(new MessageIdImpl(1, 1, expectedPartition));
+ when(msg.getValue()).thenReturn(null);
+
+ AtomicInteger ackCount = new AtomicInteger(0);
+
+ Record<GenericObject> record = PulsarRecord.<GenericObject>builder()
+ .topicName(pulsarTopic)
+ .message(msg)
+ .ackFunction(ackCount::incrementAndGet)
+ .failFunction(() -> {})
+ .build();
+
+ // Add the pulsar record to pendingFlushQueue
+ sink.pendingFlushQueue.add(record);
+
+ // Build committedOffsets with the given expectedKafkaTopic and expectedPartition
+ Map<TopicPartition, OffsetAndMetadata> committedOffsets = new HashMap<>();
+ committedOffsets.put(
+ new TopicPartition(expectedKafkaTopic, expectedPartition),
+ new OffsetAndMetadata(sink.getMessageOffset(record))
+ );
+
+ // Trigger actUntil manually
Review Comment:
Typo in comment: “Trigger actUntil manually” should be “Trigger ackUntil manually”.
```suggestion
// Trigger ackUntil manually
```
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#issuecomment-4180328499
@lhotari done.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3105380061
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -300,9 +300,18 @@ protected void ackUntil(Record<GenericObject> lastNotFlushed,
partitionOffset.put(tp.partition(), e.getValue().offset());
}
+ int ackRequestedCount = 0;
for (Record<GenericObject> r : pendingFlushQueue) {
- final String topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
- final int partition = r.getPartitionIndex().orElse(0);
+ final String topic;
+ final int partition;
+ if (shouldCollapsePartitionedTopic(r)) {
+ TopicName tn = TopicName.get(r.getTopicName().get());
+ partition = tn.getPartitionIndex();
+ topic = sanitizeNameIfNeeded(tn.getPartitionedTopicName(), sanitizeTopicName);
+ } else {
+ partition = r.getPartitionIndex().orElse(0);
+ topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
+ }
Review Comment:
Refactored into `TopicPartitionResolver` and moved directly related methods into it.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#discussion_r3030485081
##########
kafka-connect-adaptor/src/main/java/org/apache/pulsar/io/kafka/connect/KafkaConnectSink.java:
##########
@@ -300,9 +300,18 @@ protected void ackUntil(Record<GenericObject> lastNotFlushed,
partitionOffset.put(tp.partition(), e.getValue().offset());
}
+ int ackRequestedCount = 0;
for (Record<GenericObject> r : pendingFlushQueue) {
- final String topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
- final int partition = r.getPartitionIndex().orElse(0);
+ final String topic;
+ final int partition;
+ if (shouldCollapsePartitionedTopic(r)) {
+ TopicName tn = TopicName.get(r.getTopicName().get());
+ partition = tn.getPartitionIndex();
+ topic = sanitizeNameIfNeeded(tn.getPartitionedTopicName(), sanitizeTopicName);
+ } else {
+ partition = r.getPartitionIndex().orElse(0);
+ topic = sanitizeNameIfNeeded(r.getTopicName().orElse(topicName), sanitizeTopicName);
+ }
Review Comment:
since this logic is duplicated in toSourceRecord method, it could be useful to create a private internal class to handle the logic and also move the shouldCollapsePartitionedTopic and other directly related methods there unless there's a need to use them in the parent class. The topic and partition could be retrieved after initialization. The logic could be executed in the constructor.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][io] Fix acknowledgments not being sent when collapsePartitionedTopics=true in kafka-connect-adapter [pulsar-connectors]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #11:
URL: https://github.com/apache/pulsar-connectors/pull/11#issuecomment-4198716340
@sandeep-mst Please check the review comments
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org