You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "casuallc (via GitHub)" <gi...@apache.org> on 2023/04/06 08:22:19 UTC

[GitHub] [rocketmq-connect] casuallc opened a new pull request, #463: [rocketmq-replicator] Support create producer with connector's params…

casuallc opened a new pull request, #463:
URL: https://github.com/apache/rocketmq-connect/pull/463

   ## What is the purpose of the change
   
   In source task, producer is create with default config in `connect-standalone.conf`.
   
   This commit support use connector's config to create producer.
   
   
   ## Brief changelog
   
   XX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq-connect/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-connect] odbozhou commented on pull request #463: [rocketmq-replicator] Support create producer with connector's params…

Posted by "odbozhou (via GitHub)" <gi...@apache.org>.
odbozhou commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-1498948990

   In my opinion, this pr has some conflicts with the design of connect
   Here is my opinion
   1. There are two kinds of connectors: source and sink. The destination of the source is the RocketMQ cluster where the current Connector Worker cluster is located
   2. Worker configuration should come from connect.conf, just like broker configuration comes from broker.conf
   3. The connector's own configuration should not affect the configuration of the Worker
   4. As part of the rocketmq capability, the replicator can synchronize messages from other rocketmq clusters to the current cluster


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-connect] casuallc commented on pull request #463: [rocketmq-replicator] Support create producer with connector's params…

Posted by "casuallc (via GitHub)" <gi...@apache.org>.
casuallc commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-1498976755

   The connector is depolyed alone , so we should not bind to only one rocketmq cluster.
   We can use the connector as a channel, user can config the source and dest.
   
   And then what's the meaning to config `dest.endpoint` in `rocketmq-replicator` ? @odbozhou 
   
   


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-connect] odbozhou commented on pull request #463: [rocketmq-replicator] Support create producer with connector's params…

Posted by "odbozhou (via GitHub)" <gi...@apache.org>.
odbozhou commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-1498946005

   In my opinion, this pr has some conflicts with the design of connect
   Here is my opinion
   1. There are two kinds of connectors: source and sink. The destination of the source is the RocketMQ cluster where the current Connector Worker cluster is located
   2. Worker configuration should come from connect.conf, just like broker configuration comes from broker.conf
   3. The connector's own configuration should not affect the configuration of the Worker
   4. As part of the rocketmq capability, the replicator can synchronize messages from other rocketmq clusters to the current cluster


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rocketmq-replicator] Support create producer with connector's params… [rocketmq-connect]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#discussion_r3839500181


##########
connectors/rocketmq-replicator/src/main/java/org/apache/rocketmq/replicator/ReplicatorSourceTask.java:
##########
@@ -699,9 +717,9 @@ public void start(KeyValue config) {
         connectorConfig.setDestInstanceId(config.getString(ReplicatorConnectorConfig.DEST_INSTANCEID));
         connectorConfig.setDestEndpoint(config.getString(ReplicatorConnectorConfig.DEST_ENDPOINT));

Review Comment:
   The task still reads the destination endpoint from ReplicatorConnectorConfig.DEST_ENDPOINT, but ReplicatorSourceConnector now writes it under ConnectorConfig.RMQ_NAMESRVADDR. As a result, connectorConfig.getDestEndpoint() will be null in the task, which may break any logic that depends on the destination nameserver address.



##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/utils/ConnectUtil.java:
##########
@@ -111,21 +109,49 @@ public static AllocateConnAndTaskStrategy initAllocateConnAndTaskStrategy(Worker
         }

Review Comment:
   The new producer initialization overload that reads connector-level ACL/namesrv/group settings is not covered by any visible test changes. Consider adding unit tests for both the use.namesrv.of.connector=true and false branches, including cases where keys are missing.



##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/config/ConnectorConfig.java:
##########
@@ -67,6 +67,16 @@ public class ConnectorConfig {
     public static final int ERRORS_RETRY_MAX_DELAY_DEFAULT = 60000;
     public static final String ERRORS_TOLERANCE_CONFIG = "errors.tolerance";
     public static final ToleranceType ERRORS_TOLERANCE_DEFAULT = ToleranceType.NONE;
+    /**
+     * Use connector's namesrv address to create producer in `SourceTask`.
+     */
+    public final static String USE_NAMESRV_OF_CONNECTOR = "use.namesrv.of.connector";
+    public static final String RMQ_ACL_ENABLE = "rmq.acl.enable";
+    public static final String RMQ_ACCESS_KEY = "rmq.access.key";

Review Comment:
   RMQ_SECRET_KEY is defined as "rmq.secret_key" (underscore separator) while RMQ_ACCESS_KEY uses "rmq.access.key" (dot separator). This inconsistency is likely a typo and can cause user-provided secret keys to be ignored if they follow the dotted naming pattern of the other rmq.* keys.



-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-connect] odbozhou commented on pull request #463: [rocketmq-replicator] Support create producer with connector's params…

Posted by "odbozhou (via GitHub)" <gi...@apache.org>.
odbozhou commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-1500014066

   > dest.endpoint
   dest.endpoint  
   
   
   > The connector is depolyed alone , so we should not bind to only one rocketmq cluster. We can use the connector as a channel, user can config the source and dest.
   > 
   > And then what's the meaning to config `dest.endpoint` in `rocketmq-replicator` ? @odbozhou
   
   The purpose of dest.endpoint is to allow the replicator to connect itself to the current cluster, so that the ability to automatically create a target topic or automatically create a consumerGroup can be realized.
   For example, the replicator_checkpoint topic needs to be created in the checkpoint connector to the target rocketmq cluster.
   
   In addition to the points mentioned above, it is also very important that the consumer side can use its perfect offset management mechanism to easily achieve at least one transmission. Because the producer logic is relatively simple, it can achieve at least one transmission in scenarios with poor network conditions. A transfer is more difficult. This is why replicator uses source to implement instead of sink.


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-connect] casuallc commented on pull request #463: [rocketmq-replicator] Support create producer with connector's params…

Posted by "casuallc (via GitHub)" <gi...@apache.org>.
casuallc commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-1498682215

   @odbozhou Please take a look.


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rocketmq-replicator] Support create producer with connector's params… [rocketmq-connect]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#discussion_r3890868360


##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/utils/ConnectUtil.java:
##########
@@ -111,21 +109,49 @@ public static AllocateConnAndTaskStrategy initAllocateConnAndTaskStrategy(Worker
         }
     }
 
-    public static DefaultMQProducer initDefaultMQProducer(WorkerConfig connectConfig) {
+    public static DefaultMQProducer initDefaultMQProducer(WorkerConfig connectConfig, ConnectKeyValue keyValue) {

Review Comment:
   **[Info]** The overloaded `initDefaultMQProducer(WorkerConfig)` method now delegates to the new method with `null` keyValue. This is a clean backward-compatible approach. Consider adding a brief Javadoc comment to explain the `USE_NAMESRV_OF_CONNECTOR` flag behavior for future maintainers.



-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rocketmq-replicator] Support create producer with connector's params… [rocketmq-connect]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#issuecomment-5129829705

   ⚠️ **Merge conflict detected**
   
   This PR has conflicts with the base branch and cannot be merged. Please rebase or merge the base branch into your branch and resolve the conflicts:
   
   ```bash
   git fetch origin
   git checkout feature_replicator
   git rebase origin/main
   # resolve conflicts, then:
   git push --force-with-lease
   ```
   
   This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.
   
   ---
   *Automated notification by github-manager-bot*


-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rocketmq-replicator] Support create producer with connector's params… [rocketmq-connect]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #463:
URL: https://github.com/apache/rocketmq-connect/pull/463#discussion_r3721700578


##########
connectors/rocketmq-replicator/src/main/java/org/apache/rocketmq/replicator/ReplicatorSourceConnector.java:
##########
@@ -16,12 +16,23 @@
  */

Review Comment:
   No test changes detected alongside source modifications. Consider adding tests to cover the changes.



-- 
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@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org