baomingyu commented on a change in pull request #2262:
URL: https://github.com/apache/incubator-inlong/pull/2262#discussion_r790097352



##########
File path: 
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/pulsar/PulsarClientService.java
##########
@@ -228,10 +237,14 @@ private void createConnection(CreatePulsarClientCallBack 
callBack) throws FlumeE
     }
 
     private PulsarClient initPulsarClient(String pulsarUrl) throws Exception {
-        return PulsarClient.builder()
-                .serviceUrl(pulsarUrl)
-                .connectionTimeout(clientTimeout, TimeUnit.SECONDS)
-                .build();
+        ClientBuilder builder = PulsarClient.builder();
+        if (PULSAR_DEFAULT_AUTH_TYPE.equals(authType) && 
StringUtils.isNotEmpty(token)) {
+            builder.authentication(AuthenticationFactory.token(token));
+        }
+        builder.serviceUrl(pulsarUrl)
+                .connectionTimeout(clientTimeout, TimeUnit.SECONDS);
+        return builder.build();
+

Review comment:
       done
   

##########
File path: inlong-dataproxy/conf/flume-mulit-pulsar-udp-example.conf
##########
@@ -91,6 +94,9 @@ agent1.sinks.pulsar-sink-msg1.disk-io-rate-per-sec=20000000
 agent1.sinks.pulsar-sink-msg2.channel = ch-msg2
 agent1.sinks.pulsar-sink-msg2.type = 
org.apache.inlong.dataproxy.sink.PulsarSink
 agent1.sinks.pulsar-sink-msg2.pulsar_server_url_list = pulsar://127.0.0.1:6650
+#Optional pulsar auth type and token config
+#agent1.sinks.pulsar-sink-msg2.pulsar_auth_type = token
+#agent1.sinks.pulsar-sink-msg2.pulsar_token = XXXXXXXXXX

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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to