You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/19 08:23:08 UTC

[GitHub] [pulsar] freeznet opened a new pull request, #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

freeznet opened a new pull request, #16675:
URL: https://github.com/apache/pulsar/pull/16675

   Fixes #16674
   
   ### Motivation
   
   Allow user customize the reader configs in pulsar-io-debezium and pulsar-io-kafka-connect-adaptor.
   
   ### Modifications
   
   - add `offset.storage.reader.config` to `PulsarKafkaWorkerConfig`
   - add `pulsar.reader.config` to `PulsarDatabaseHistory`
   - add utils to pulsar-io-common
   - add pulsar-io-common dependency to pulsar-io-kafka-connect-adaptor
   - add tests
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [ ] `doc-not-needed` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)


-- 
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


[GitHub] [pulsar] momo-jun commented on pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
momo-jun commented on PR #16675:
URL: https://github.com/apache/pulsar/pull/16675#issuecomment-1195010543

   Hi @freeznet, do you have any updates on the required doc?


-- 
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


[GitHub] [pulsar] codelipenghui merged pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #16675:
URL: https://github.com/apache/pulsar/pull/16675


-- 
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


[GitHub] [pulsar] freeznet commented on pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
freeznet commented on PR #16675:
URL: https://github.com/apache/pulsar/pull/16675#issuecomment-1192117236

   /pulsarbot run-failure-checks


-- 
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


[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on code in PR #16675:
URL: https://github.com/apache/pulsar/pull/16675#discussion_r925141666


##########
pulsar-io/common/src/main/java/org/apache/pulsar/io/common/IOConfigUtils.java:
##########
@@ -40,6 +43,15 @@ public static <T> T loadWithSecrets(Map<String, Object> map, Class<T> clazz, Sin
         return loadWithSecrets(map, clazz, secretName -> sinkContext.getSecret(secretName));
     }
 
+    public static Map<String, Object> loadConfigFromJsonString(String config) throws JsonProcessingException {
+        if (!isBlank(config)) {
+            ObjectMapper mapper = new ObjectMapper();
+            return mapper.readValue(config, new TypeReference<Map<String, Object>>() {
+            });
+        } else {
+            return new HashMap<>();

Review Comment:
   Can be an empty map?



##########
pulsar-io/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarDatabaseHistoryTest.java:
##########
@@ -239,4 +248,13 @@ public void testExists() throws Exception {
         // dummytopic should not exist yet
         assertFalse(history.exists());
     }
+
+    @Test
+    public void testSubscriptionName() throws Exception {
+        // happy path
+        testHistoryTopicContent(true, false, true);
+        assertTrue(history.exists());
+        List<String> subscriptions = admin.topics().getSubscriptions(topicName);
+        assertTrue(subscriptions.contains("my-subscription"));

Review Comment:
   Please check the failed test.



-- 
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


[GitHub] [pulsar] freeznet commented on a diff in pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
freeznet commented on code in PR #16675:
URL: https://github.com/apache/pulsar/pull/16675#discussion_r925389455


##########
pulsar-io/common/src/main/java/org/apache/pulsar/io/common/IOConfigUtils.java:
##########
@@ -40,6 +43,15 @@ public static <T> T loadWithSecrets(Map<String, Object> map, Class<T> clazz, Sin
         return loadWithSecrets(map, clazz, secretName -> sinkContext.getSecret(secretName));
     }
 
+    public static Map<String, Object> loadConfigFromJsonString(String config) throws JsonProcessingException {
+        if (!isBlank(config)) {
+            ObjectMapper mapper = new ObjectMapper();
+            return mapper.readValue(config, new TypeReference<Map<String, Object>>() {
+            });
+        } else {
+            return new HashMap<>();

Review Comment:
   addressed in the latest commit.



##########
pulsar-io/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarDatabaseHistoryTest.java:
##########
@@ -239,4 +248,13 @@ public void testExists() throws Exception {
         // dummytopic should not exist yet
         assertFalse(history.exists());
     }
+
+    @Test
+    public void testSubscriptionName() throws Exception {
+        // happy path
+        testHistoryTopicContent(true, false, true);
+        assertTrue(history.exists());
+        List<String> subscriptions = admin.topics().getSubscriptions(topicName);
+        assertTrue(subscriptions.contains("my-subscription"));

Review Comment:
   fixed



-- 
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


[GitHub] [pulsar] freeznet commented on pull request #16675: [improve][connector] add reader config to `pulsar-io-debezium` and `pulsar-io-kafka-connect-adaptor`

Posted by GitBox <gi...@apache.org>.
freeznet commented on PR #16675:
URL: https://github.com/apache/pulsar/pull/16675#issuecomment-1192449083

   /pulsarbot run-failure-checks


-- 
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