forked from sovrin-foundation/aries-cloudagent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openwallet-foundation#72 from hyperledger/main
update main
- Loading branch information
Showing
415 changed files
with
30,940 additions
and
5,105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: acapy-integration-tests | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'pull_request' && github.repository == 'hyperledger/aries-cloudagent-python') || (github.event_name != 'pull_request') | ||
steps: | ||
- name: checkout-acapy | ||
uses: actions/checkout@v2 | ||
with: | ||
path: acapy | ||
- name: run-von-network | ||
uses: ./acapy/actions/run-von-network | ||
- name: run-indy-tails-server | ||
uses: ./acapy/actions/run-indy-tails-server | ||
- name: run-integration-tests | ||
uses: ./acapy/actions/run-integration-tests | ||
# to run with a specific set of tests include the following parameter: | ||
# with: | ||
# TEST_SCOPE: "-t @T001-RFC0037" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Outbound Queues in ACA-py | ||
|
||
## Background | ||
|
||
By default, messages often stay in ACA-py memory for long periods of time without being delivered. As a result, when the ACA-py Python process is terminated unexpectedly, messages are lost. | ||
|
||
But with recent changes, outbound messages can now be sent to a message queue of your choice instead of being delivered by ACA-py. This queue is external to the ACA-py process, and can be configured for the durability requirements you want. This new concept of an "outbound queue" is intended to be an optional replacement to the current ACA-py outbound transport (i.e. option `-ot`, `--outbound-transport`). | ||
|
||
If you run an outbound queue, you will also need to run a new service, a delivery agent, to actually deliver the message. See more details below. | ||
|
||
## Usage Details | ||
|
||
A new set of commandline options have been added to provide a way for users to "opt in" to use of the outbound queue. These new options are as follows: | ||
|
||
- `-oq`, `--outbound-queue`: specifies the queue connection details. | ||
- `-oqp`, `--outbound-queue-prefix`: defines a prefix to use when generating the topic key. | ||
- `-oqc`, `--outbound-queue-class`: specify the location of a custom queue class. | ||
|
||
Only the first, `--outbound-queue`, is required if you would like to opt into the outbound queue to replace `--outbound-transport`. The input for this option takes the form `[protocol]://[host]:[port]`. So for example, if the queue I want to use is Redis, on host `myredis.mydomain.com` using the default port for Redis, the string would be as follows: `redis://myredis.mydomain.com:6379` | ||
|
||
The second option, `--outbound-queue-prefix`, specifies the queue topic prefix. The queue topic is generated in the following form: `{prefix}.outbound_transport`. The default value for this commandline option is the value `acapy`, so a queue key of `acapy.outbound_transport` is generated in the case of the default settings. ACA-py will send messages to the queue using this generated key as the topic. | ||
|
||
The third option, `--outbound-queue-class`, specifies the queue backend. By default, this is `aries_cloudagent.transport.outbound.queue.redis:RedisOutboundQueue`, which specifies ACA-py's builtin Redis `LIST` backend. Users can define their own class, inheriting from `BaseOutboundQueue`, to implement a queue backend of their choice. This commandline option is the official entrypoint of ACA-py's pluggable queue interface. Developers must specify a Python dotpath to a module importable in the current `PYTHONPATH`, followed by a colon, followed by the name of their custom class. | ||
|
||
## Delivery Agent | ||
|
||
When using `--outbound-queue` instead of `--outbound-transport`, ACA-py no longer delivers the messages to destinations. Instead, a delivery service ([a prototype can be found here](https://github.com/andrewwhitehead/aca-deliver)) would need to be run. This service should pick up a message from the queue and then deliver that message. | ||
|
||
When running `--outbound-queue`, ACA-py serializes messages to be sent to the queue by using MessagePack. MessagePack is a protocol to serialize content into a compact binary format. ACA-py generates keys in MessagePack as follows: | ||
- `endpoint` - specifies the endpoint for the message. | ||
- `headers` - specifies a set of key-value pairs representing message headers. | ||
- `payload` - the raw binary content of the message. | ||
|
||
The delivery service will need to deserialize the binary content on the consuming end. The result will then be a key-value data structure (for example, a `dict` in Python). So the deseralized message, deserialized into a Python `dict` for example, would be in the following form: | ||
``` | ||
{ | ||
"headers": {"Content-Type": "..."}, | ||
"endpoint": "...", | ||
"payload": "..." | ||
} | ||
``` | ||
The delivery agent should process this message and deliver it to the recipient as appropriate. | ||
|
||
## Backend-Specific Notes | ||
|
||
### Redis | ||
|
||
Value for `--outbound-queue-class` to use this backend: | ||
- `aries_cloudagent.transport.outbound.queue.redis:RedisOutboundQueue` | ||
|
||
This is a queue backend, using the `LIST` data type in Redis. When using Redis, the delivery service consuming this queue in order to send outbound messages over transport will need to pop from the left side of the queue (i.e. the Redis `LPOP` command) to get messages in the order they were sent. | ||
|
||
Users will need to configure [Redis persistence](https://redis.io/topics/persistence) to gain message durability benefits in their Redis deployment. Redis by default runs entirely in-memory, so it is subject to the same data loss characteristics as ACA-py unless you also configure it to run in persistence mode. |
Oops, something went wrong.