You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/01/21 08:12:33 UTC
[GitHub] [incubator-inlong] dockerzhang commented on a change in pull request #2262: [INLONG-2218][DataProxy] Inlong-DataProxy support authentication access Pulsar
dockerzhang commented on a change in pull request #2262:
URL: https://github.com/apache/incubator-inlong/pull/2262#discussion_r789437794
##########
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:
remove empty line
##########
File path: inlong-dataproxy/conf/flume-mulit-pulsar-udp-example.conf
##########
@@ -79,6 +79,9 @@ agent1.channels.ch-msg6.fsyncInterval = 10
agent1.sinks.pulsar-sink-msg1.channel = ch-msg1
agent1.sinks.pulsar-sink-msg1.type = org.apache.inlong.dataproxy.sink.PulsarSink
agent1.sinks.pulsar-sink-msg1.pulsar_server_url_list = pulsar://127.0.0.1:6650
+#Optional pulsar auth type and token config
+#agent1.sinks.pulsar-sink-msg1.pulsar_auth_type = token
+#agent1.sinks.pulsar-sink-msg1.pulsar_token = XXXXXXXXXX
Review comment:
change the default value for the token,`xxxxx` is not useful.
##########
File path: inlong-dataproxy/conf/flume-mulit-pulsar-udp-example.conf
##########
@@ -103,6 +109,9 @@ agent1.sinks.pulsar-sink-msg2.disk-io-rate-per-sec=20000000
agent1.sinks.pulsar-sink-msg5.channel = ch-msg5
agent1.sinks.pulsar-sink-msg5.type = org.apache.inlong.dataproxy.sink.PulsarSink
agent1.sinks.pulsar-sink-msg5.pulsar_server_url_list = pulsar://127.0.0.1:6650
+#Optional pulsar auth type and token config
+#agent1.sinks.pulsar-sink-msg5.pulsar_auth_type = token
+#agent1.sinks.pulsar-sink-msg5.pulsar_token = XXXXXXXXXX
Review comment:
ditto
##########
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:
ditto
##########
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
Review comment:
add a space after `#`.
--
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@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org