Skip to content
Snippets Groups Projects
Commit bdee9dcb authored by Steve Wirt's avatar Steve Wirt
Browse files

Issue #3442089 by RichardDavies: Why is there a queue?

parent a84eaeee
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,7 @@
This module provides a set of utilities to have your Drupal powered site use [GovDelivery's Communications Cloud API - Bulletins resource](https://developer.govdelivery.com/api/comm_cloud_v1/Default.htm#API/Comm%20Cloud%20V1/API_CommCloudV1_Bulletins.htm) to create and send Bulletin notifications including an external trigger endpoint. This module supports custom code a developer must create to send the bulletin. It does not create them by itself.
It is more focused in function than the [GovDelivery Integration module](https://www.drupal.org/project/govdelivery).
It is more focused in function than the GovDelivery Integration module https://www.drupal.org/project/govdelivery.
## How to use the service to add a bulletin to the queue.
......@@ -45,7 +43,7 @@ To add a test, it would look like this.
->addToQueue();
```
[GovDelivery Bulletins API](https://developer.govdelivery.com/api/comm_cloud_v1/Default.htm#API/Comm%20Cloud%20V1/API_CommCloudV1_Bulletins_CreateandSendBulletin.htm)
GovDelivery Bulletins API https://developer.govdelivery.com/api/comm_cloud_v1/Default.htm#API/Comm%20Cloud%20V1/API_CommCloudV1_Bulletins_CreateandSendBulletin.htm
## How to securely store GovDelivery API endpoint, username and password.
......@@ -64,6 +62,39 @@ $apiUsername = $config->get('govdelivery_username');
$apiPassword = $config->get('govdelivery_password');
```
You can also save your username and password by setting them in the [GovDelivery Bulletins Admin form](/admin/config/services/govdelivery-bulletins/settings).
You can also save your username and password by setting them in the GovDelivery
Bulletins Admin form /admin/config/services/govdelivery-bulletins/settings.
This is strongly discouraged, and presents a security vulnerability.
## FAQs
### Why does this use a queue?
* A queue makes sure that in the event of a problem reaching the GovDelivery
endpoint, no bulletins get lost. Anything that is unsuccessfully received by
GovDelivery stays in the queue and is retried until the send is successful.
* A queue also makes sure that in the event of sending many messages, that
sending them is not a blocking process that causes your site to timeout or
become unresponsive.
### How do we trigger processing of the queue?
There are three ways to trigger the GovDelivery Bulletin queue:
1. By hand - Go to /admin/config/services/govdelivery-bulletins/queue and click
the "Process queue" button. This is used mainly during initial testing. It is
not recommended as a sustainable solution.
2. Drush command 'drush queue:run govdelivery_bulletins'. This is useful for
testing while building your custom implementation. It is also useful for
making the queue get processed by cron or any other task runner that can run
Drush commands.
3. GET request to external endpoint - Making a GET request to
`https://example.com/api/govdelivery_bulletins/queue?EndTime={timestamp that
anything before this should be sent}` can be used to trigger the queue from an
external tool that does not have access to run drush commands on the site.
### Why is the queue list so hard to read?
The queue list /admin/config/services/govdelivery-bulletins/queue is not meant
for everyone. It is mainly for developers to be able to see why sending a
specifc item is failing. The queue item shows the API payload in the exact form
it is sent, so that nothing gets hidden or covered up. It is mainly a debugging
tool, or a quick way to monitor that the queue is running.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment