From 04724ee736ef95038a7801ec3d90d26b924695eb Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 3 Sep 2024 13:22:13 +0300 Subject: [PATCH] UHF-10559: Updated documentation --- documentation/pubsub-messaging.md | 32 +++------------------------ src/Drush/Commands/PubSubCommands.php | 6 ++--- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/documentation/pubsub-messaging.md b/documentation/pubsub-messaging.md index 9e7588c..7b819dc 100644 --- a/documentation/pubsub-messaging.md +++ b/documentation/pubsub-messaging.md @@ -4,10 +4,10 @@ Provides an integration to [Azure's Web PubSub service](https://azure.microsoft. ## Configuration -You must define a [JSON Vault item](/documentation/api-accounts.md#managing-external-api-credentials) to use this feature. The data field should be a JSON string containing `endpoint`, `hub`, `group` and `access_key`: +You must define a [JSON Vault item](/documentation/api-accounts.md#managing-external-api-credentials) to use this feature. The data field should be a JSON string containing `endpoint`, `hub`, `group` and `access_key` and optional `secondary_access_key`: ```json -{"endpoint": "", "hub": "", "group": "", "access_key": ""} +{"endpoint": "", "hub": "", "group": "", "access_key": "", "secondary_access_key": ""} ``` ## Usage @@ -85,34 +85,8 @@ $pubsub_account = [ 'hub' => '', 'group' => '', 'access_key' => '', + 'secondary_access_key' => '', ]), ]; $config['helfi_api_base.api_accounts']['vault'][] = $pubsub_account; ``` - -## Solving pubsub related problems - -If menus or news or other content doesn't update normally, you can verify that the pubsub service is working correctly - -### Artemis is not up on etusivu-instance -- See that frontpage production has artemis pod up and running - -#### If the pod is not running -- See if there is a pipeline to get it up again OR -- Contact HiQ - - -### Pubsub-process is not running -- Go to any production site's cron pod - - run `ps aux`, you should see pubsub related process on the list - -#### If the process is not running -- Short term solution is to run `drush cr` to force the site to fetch new data. -- You can run production deployment to get it running again. - - -### Bad credentials -- Go to any cron pod and look for authorization error - -#### Update the credentials -- Go and update the pubsub-vault credentials diff --git a/src/Drush/Commands/PubSubCommands.php b/src/Drush/Commands/PubSubCommands.php index 8d71ccb..bb61669 100644 --- a/src/Drush/Commands/PubSubCommands.php +++ b/src/Drush/Commands/PubSubCommands.php @@ -28,11 +28,11 @@ final class PubSubCommands extends DrushCommands { /** * Constructs a new instance. * - * @param \Drupal\helfi_api_base\Azure\PubSub\PubSubManagerInterface $clientManager + * @param \Drupal\helfi_api_base\Azure\PubSub\PubSubManagerInterface $pubSubManager * The PubSub client. */ public function __construct( - private readonly PubSubManagerInterface $clientManager, + private readonly PubSubManagerInterface $pubSubManager, ) { parent::__construct(); } @@ -47,7 +47,7 @@ public function __construct( public function listen() : int { for ($received = 0; $received < self::MAX_MESSAGES; $received++) { try { - $message = $this->clientManager->receive(); + $message = $this->pubSubManager->receive(); $this->io() ->writeln(sprintf('Received message [#%d]: %s', $received, $message)); }