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/20 09:32:30 UTC

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

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