Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change removes the use of Azure Storage Queues from the system. Instead, we now use Azure ServiceBus for the queuing mechanism.
This has several advantages. Notably, ServiceBus has a push-style API (via AMQP) and Storage Queues only expose a REST API. This means that to integrate with Storage Queues we had to periodically poll the REST API, check if there are new messages and then act on them. With ServiceBus, we can instead just define an event listener for incoming messages and act on them as they get pushed to the receiver via AMQP. This is neater in terms of code and also more efficient in terms of processing.
Note that the push-style API for ServiceBus is not available in the Python SDK so the queue listener is implemented in C#. The listener indefinitely waits for messages from ServiceBus and on receipt makes a request to a Python service running in the same pod which then acts on the message. All the previous queue processing jobs have thus been converted to HTTP endpoints so that the queue listener can easily interact with them.
The new separation of concerns also has a few incidental added benefits. For instance, the distinction between business logic (processing of the queue message) and action triggers (receipt of the queue message) is now very neat and clear. Additionally, we now have a unified interface for all the actions in the system: everything can be triggered via a simple HTTP call whereas previously we had a mix of Python HTTP endpoints and Python daemons. This new uniformity for example simplifies local testing.
The approach implemented by this change is similar to what I described in this article: https://medium.com/@clemens.wolff/using-the-ambassador-pattern-for-reliable-pipes-and-filters-text-processing-9ebbea8f82c4
There are also a few other changes included in this pull request including:
lokole.ca, so I updated our test data to reflect that.Resolves #16