RockteMQ-AI commented on code in PR #535:
URL: https://github.com/apache/rocketmq-connect/pull/535#discussion_r3890863119
##########
connectors/rocketmq-connect-http/src/main/java/org/apache/rocketmq/connect/http/HttpSinkTask.java:
##########
@@ -140,6 +146,32 @@ public void put(List<ConnectRecord> records) throws
ConnectException {
}
}
+ /**
+ * Get a formatted url that will replace a placeholder with Extension
Values
+ *
+ * @param url the source url str
+ * @param extensions ConnectRecord Extension Values
+ * @return the formatted url
+ */
Review Comment:
**[Critical]** `PATTERN.matcher(url).matches()` requires the **entire**
string to match the regex `\{(\w+)\}`. A real URL like
`http://api.example.com/{id}/data` will never match because `matches()` anchors
at both ends. This means the placeholder replacement will silently never
execute for any practical URL.
**Fix:** Change to `PATTERN.matcher(url).find()` which checks if the pattern
exists anywhere in the string.
--
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]