duhenglucky commented on a change in pull request #350: [ISSUE #346] bugfix
sourceTask setNamesrv error
URL: https://github.com/apache/rocketmq-externals/pull/350#discussion_r309192324
##########
File path:
rocketmq-connect/rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/connectorwrapper/Worker.java
##########
@@ -257,10 +257,10 @@ public synchronized void startTasks(Map<String,
List<ConnectKeyValue>> taskConfi
if (task instanceof SourceTask) {
DefaultMQProducer producer = new DefaultMQProducer();
-
producer.setNamesrvAddr(keyValue.getString(RuntimeConfigDefine.NAMESRV_ADDR));
+ producer.setNamesrvAddr(connectConfig.getNamesrvAddr());
String rmqProducerGroup =
keyValue.getString(RuntimeConfigDefine.RMQ_PRODUCER_GROUP);
if (StringUtils.isEmpty(rmqProducerGroup)) {
- rmqProducerGroup = connectConfig.getRmqProducerGroup();
+ rmqProducerGroup = new
StringBuilder().append(connectConfig.getRmqProducerGroup()).append(System.currentTimeMillis()).toString();
Review comment:
It is recommended to reuse the same producer as much as possible to avoid
creating many remote channels.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services