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/13 08:16:49 UTC

[GitHub] [rocketmq-eventbridge] supercym opened a new pull request, #10: Supplement http source documentation

supercym opened a new pull request, #10:
URL: https://github.com/apache/rocketmq-eventbridge/pull/10

   Supplement http source documentation


-- 
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


[GitHub] [rocketmq-eventbridge] 2011shenlin merged pull request #10: Supplement http source documentation

Posted by GitBox <gi...@apache.org>.
2011shenlin merged PR #10:
URL: https://github.com/apache/rocketmq-eventbridge/pull/10


-- 
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


[GitHub] [rocketmq-eventbridge] 2011shenlin commented on a diff in pull request #10: Supplement http source documentation

Posted by GitBox <gi...@apache.org>.
2011shenlin commented on code in PR #10:
URL: https://github.com/apache/rocketmq-eventbridge/pull/10#discussion_r872131192


##########
README.md:
##########
@@ -104,4 +104,83 @@ Header: Content-Type:"application/cloudevents+json; charset=UTF-8"
     },
     "aliyuneventbusname":"demo"
 }
-```
\ No newline at end of file
+```
+* Use HttpSource to put events
+
+EventBridge HttpSource allows you to put events to eventbus in the form of webhook.
+
+Here is an example explaining how to put events using EventBridge HttpSource.
+
+1. Create an EventBridge HttpSource
+
+    - eventSourceName: Name of EventSource
+    - eventBusName: Name of EventBus
+    - description: Description
+    - className: HttpEvent. This parameter is a fixed value and cannot be modified.
+    - config: HttpSource Config
+    - Type: Request type. Available values are 'HTTP', 'HTTPS' and 'HTTP&HTTPS'.
+    - Method: Allowed HTTP request methods. The request will be filtered if the http request method type for accessing the webhook does not meet the configuration.
+    - SecurityConfig: Security configuration type. Available values are 'none', 'ip' and 'referer'.
+    - Ip: IP security configuration. Http requests whose source ip is not in the configured network segment will be filtered if the security configuration is selected as 'ip'.
+    - Referer: Referer security configuration. HTTP requests whose referer is not in this configuration will be filtered if the security configuration is selected as 'referer'.
+
+A webhook will be generated after the creation of HttpSource.
+```
+http://127.0.0.1:7001/source/createEventSource
+```
+```json
+{
+  "eventSourceName": "httpEventSourceDemo",
+  "eventBusName": "demo",
+  "description": "http source demo",
+  "className": "HttpEvent",
+  "config": {
+    "Type": "HTTP&HTTPS",
+    "Method": ["GET", "POST"],
+    "SecurityConfig": "ip",
+    "Ip": ["10.0.0.0/8"],
+    "Referer":[]
+  }
+}
+```
+2. Put event to EventBus
+
+Http request to access this webhook will be converted into a CloudEvent and delivered to eventbus.
+
+```
+http://127.0.0.1/webhook/putEvents?token=43146d108b2123
+Header: Content-Type:"application/json"
+```
+```json
+{

Review Comment:
   Provide a DEMO of HTTP CURL? which match the cloudevent result.



-- 
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


[GitHub] [rocketmq-eventbridge] supercym commented on a diff in pull request #10: Supplement http source documentation

Posted by GitBox <gi...@apache.org>.
supercym commented on code in PR #10:
URL: https://github.com/apache/rocketmq-eventbridge/pull/10#discussion_r876813181


##########
README.md:
##########
@@ -104,4 +104,83 @@ Header: Content-Type:"application/cloudevents+json; charset=UTF-8"
     },
     "aliyuneventbusname":"demo"
 }
-```
\ No newline at end of file
+```
+* Use HttpSource to put events
+
+EventBridge HttpSource allows you to put events to eventbus in the form of webhook.
+
+Here is an example explaining how to put events using EventBridge HttpSource.
+
+1. Create an EventBridge HttpSource
+
+    - eventSourceName: Name of EventSource
+    - eventBusName: Name of EventBus
+    - description: Description
+    - className: HttpEvent. This parameter is a fixed value and cannot be modified.
+    - config: HttpSource Config
+    - Type: Request type. Available values are 'HTTP', 'HTTPS' and 'HTTP&HTTPS'.
+    - Method: Allowed HTTP request methods. The request will be filtered if the http request method type for accessing the webhook does not meet the configuration.
+    - SecurityConfig: Security configuration type. Available values are 'none', 'ip' and 'referer'.
+    - Ip: IP security configuration. Http requests whose source ip is not in the configured network segment will be filtered if the security configuration is selected as 'ip'.
+    - Referer: Referer security configuration. HTTP requests whose referer is not in this configuration will be filtered if the security configuration is selected as 'referer'.
+
+A webhook will be generated after the creation of HttpSource.
+```
+http://127.0.0.1:7001/source/createEventSource
+```
+```json
+{
+  "eventSourceName": "httpEventSourceDemo",
+  "eventBusName": "demo",
+  "description": "http source demo",
+  "className": "HttpEvent",
+  "config": {
+    "Type": "HTTP&HTTPS",
+    "Method": ["GET", "POST"],
+    "SecurityConfig": "ip",
+    "Ip": ["10.0.0.0/8"],
+    "Referer":[]
+  }
+}
+```
+2. Put event to EventBus
+
+Http request to access this webhook will be converted into a CloudEvent and delivered to eventbus.
+
+```
+http://127.0.0.1/webhook/putEvents?token=43146d108b2123
+Header: Content-Type:"application/json"
+```
+```json
+{

Review Comment:
   done



-- 
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