You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/05 06:10:38 UTC

[GitHub] [rocketmq-eventbridge] supercym commented on a diff in pull request #9: support http source

supercym commented on code in PR #9:
URL: https://github.com/apache/rocketmq-eventbridge/pull/9#discussion_r865579946


##########
domain/src/main/java/org/apache/rocketmq/eventbridge/domain/model/source/HTTPEventSourceService.java:
##########
@@ -17,18 +17,56 @@
 
 package org.apache.rocketmq.eventbridge.domain.model.source;
 
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.stream.Collectors;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.eventbridge.domain.common.enums.EventSourceTypeEnum;
+import org.apache.rocketmq.eventbridge.domain.model.PaginationResult;
 import org.apache.rocketmq.eventbridge.domain.model.bus.EventBusService;
 import org.apache.rocketmq.eventbridge.domain.repository.EventSourceRepository;
+import org.apache.rocketmq.eventbridge.exception.EventBridgeException;
+import org.apache.rocketmq.eventbridge.tools.NetUtil;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.DigestUtils;
+
+import static org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode.ExceedHttpSourceParametersCount;
+import static org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode.GenerateTokenError;
+import static org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode.HttpSourceParametersEmpty;
+import static org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode.HttpSourceParametersInvalid;
+
 @Service
 public class HTTPEventSourceService extends EventSourceService {
 
     private static final String CLASS_NAME = "HttpEvent";
 
+    private static final Integer GET_TOKEN_TIMES = 100;
+    public static final String PUBLIC_HTTP_WEBHOOK_SCHEMA = "http://%s.eventbridge.%s.aliyuncs.com/webhook/putEvents?token=%s";
+    public static final String PUBLIC_HTTPS_WEBHOOK_SCHEMA = "https://%s.eventbridge.%s.aliyuncs.com/webhook/putEvents?token=%s";

Review Comment:
   Moved webhook schema configuration to LocalConfig



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

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