-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split http adapter logic out of the broker (#29)
Items left before this can be moved out of draft state: - [x] `engine.go`: Determine the best way to pass along the context around the target adapter to the HTTP server. Since it's already being looked up in this code we shouldn't need to replicate the same code in the HTTP server, instead we should probably just pass along the context we found. - [x] Code to be deleted out of the broker - [x] `sub_mgr.go`: Is the implementation I wrote the best method to connect a request out to the HTTP server? - [x] `http server, http_client.go`: I need to get some context about the target adapter for the request in the `SendEvent()` function. I need to know the host, method, headers, ect... - [x] `http server, http_client.go`: When sending the response back - Will need to determine which is the correct timestamp to send back - [x] Testing a full round trip -- Currently the code will, Request from cURL -> http server -> broker -> quickstart component -> broker -> http server (Dies) Problem: 1. The broker was responsible for executing HTTP requests that originate from components running the Kit SDK 2. Executing HTTP requests without a "/" in it was erroring out Solution: 1. Copying the HTTP client code out of the broker and into the HTTP server running in the cluster 2. Adding in a "/" if the host if empty Testing: Verified that running the changes allowed me to execute a full round trip and receive a response: ``` { "args": {}, "data": "", "files": {}, "form": {}, "headers": { "Accept-Encoding": "gzip", "Host": "httpbin.org", "User-Agent": "Go-http-client/2.0", "X-Amzn-Trace-Id": "Root=1-66663c6c-61460ac946f419545031d61b" }, "json": null, "method": "GET", "origin": "98.225.110.56", "url": "https://httpbin.org/anything" } ```
- Loading branch information
1 parent
a854bd4
commit 2ef325d
Showing
14 changed files
with
213 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.