-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Netkan for SQS mode #2798
Conversation
4315c5c
to
6d7134f
Compare
If I spot this right, when the queue is empty |
The break/delay happens during the |
Thanks. And I should read the documentation now ^^ |
The queue names are also hardcoded atm, IMO it makes sense to outsource them too (they have to be changed before merge anyway). |
Well we're going to have to hard-code something. Either we know the queue names and use them to look up the URLs, or we know some other keys and use them to look up the names and use them to look up the URLs, etc. I'll defer to @techman83 on how this is typically handled. |
Okay. Second, sending fails indeed: |
Good points, I'm going to try deleting all the messages so I can see new ones... |
I have no idea why Amazon decided an empty body was so unacceptable that it should throw an exception; it invites silly things like sending "{}" as the body. Which is what we do now. |
Oh, I thought it was a null object that was passed in Otherwise, the PR looks fine for me. I'm impressed that you were so fast. |
I think we should pass the queue names in as CLI argments or environment variables, I think it's acceptable to look up the queue URLs when constructing the class.
I have a few ideas, but I think we should open a separate feature. There is a lot to do in the first pass, but we'll be in a much better place to rapidly get changes into the wild.
I've had a none C# dev look over the code and I think this is excellent! Likely some extra requirements will shake out as we use it in anger, but this definitely meets and surpasses the MVP. |
EDIT: Working again now. Odd. |
8034d9a
to
6db85bc
Compare
Changes in latest commit:
|
6db85bc
to
6efde20
Compare
Pushed just now:
|
6efde20
to
c1b6fe6
Compare
That's likely based around our discussion on the
Those are some awesome additions! I think for now we should let this shake out and I'm happy for it to be merged when ready and make any improvements as needed. My primary motivator for this re-architecture is to make deploying updates to production much quicker and easier. We can almost fully automate the process, meaning:
I see. Looks like a bunch of the SDKs use |
c1b6fe6
to
6c67e6a
Compare
The last blocker for this PR is code review for dependency #2788, which we need to ensure that the generated metadata is valid. If anybody is interested in having these changes merged, consider taking a look at that PR. |
Yeah, I didn't really jump on #2788 because it's line-wise a lot, but I will look at it now. |
Thanks!! Yes, it looks like a lot, but it has the advantage of being made up of many much smaller pieces, each of which is pretty simple. |
6c67e6a
to
5b97364
Compare
5b97364
to
a48c8e5
Compare
Motivation
See #2789; we want to refactor the NetKAN-bot to use AWS SQS so it can be managed and iterated more easily.
Changes
This pull request builds upon #2788 and should not be merged until after that one is merged. Click on the second commit to view the diff of the changes that are unique to this PR.
Now a new command format is supported. Note that you must set the credentials environment variables for this to work, values available upon request from @techman83:
This new command will authenticate with AWS SQS and retrieve inflation requests from the input queue in this format:
Such requests may be generated for testing with this Python script, which also requires the above environment variables and accepts a path to a .netkan file as its parameter:
This JSON is then inflated via existing Netkan logic. A message is then sent to the output queue in this format:
The output queue may be inspected with this Python script:
After this it will check the input queue again for more inflation requests, forever.
Fixes #2789.
Open questions / left to-do
This isn't 100% complete yet.
Releases
as an input attribute (to be confirmed with design committee first)Releases
as a parameter internally without re-creating theNetkanTranslator
while(true)