Skip to content

8 Message Queue

This chapter describes the Message Queue (MQ), which provides asynchronous communication between the backend services of the Wallet Provider: the Wallet Provider Backend (WPB), the Remote Wallet Secure Cryptographic Application (RWSCA), the Mobile Device Vulnerability Management (MDVM) and the Push Notification Service (PNS).

The MQ decouples the publication of an event from its processing: events published to a queue are persisted, so a temporarily unavailable consumer processes pending events as soon as it is available again, instead of the producer having to retry failed requests. Consumers acknowledge an event only after it has been processed successfully; events that are not acknowledged are redelivered. Events are therefore delivered at least once and the processing of every event is designed to be idempotent. The MQ is only reachable within the Wallet Provider's backend infrastructure, producer and consumer connections are mutually authenticated via mTLS and publishing is restricted per queue to its designated producers.

Events published to the MQ identify the targeted Wallet Instance by the mdvm_wi_id. The MDVM generates the mdvm_wi_id as its account identifier during MDVM registration and embeds it in every mdvm_token, see MDVM token. The other backends take the mdvm_wi_id from the verified mdvm_token when the Wallet Instance creates its account: the WPB and the RWSCA store it as an indexed lookup key next to their own account identifiers wpb_wi_id and rwsca_account_id, the PNS uses it as its sole account identifier. As the MDVM's signature on the mdvm_token binds the mdvm_wi_id to the possession factor wi_mdvm_auth_pubk, every backend obtains the same value for the same Wallet Instance without deriving an identifier from the key, so no canonical key representation has to be agreed between the backends. The WPB and the RWSCA hold at most one account per mdvm_wi_id, so an event matches at most one account in each backend. The mdvm_wi_id only correlates the accounts of a Wallet Instance across the backends and does not replace their own account identifiers: the wpb_wi_id and the rwsca_account_id are generated anew at every registration, so that artifacts bound to a deleted account, such as a PIN session token, cannot be used for a new account of the same Wallet Instance.

8.1 Revocation Queue

The revocation queue propagates wallet revocations between the backends, see revocation propagation between backends.

The producers are the WPB and the MDVM, the initiating backend publishes one revocation event per affected Wallet Instance to the queue. All three backends (WPB, MDVM and RWSCA) are consumers of the revocation queue and execute their respective Revoke Account operations (WPB, MDVM and RWSCA) to block the affected accounts. A revocation event contains the mdvm_wi_id, a timestamp, the initiating backend and a revocation reason (user-initiated or MDVM-initiated).

The processing of revocation events is idempotent, as marking an already revoked account as REVOKED has no further effect. Every backend, including the one that published an event, consumes all revocation events and executes its Revoke Account operation; if the initiating backend has already marked the affected account as revoked (as the MDVM does when it initiates the revocation), processing its own event has no further effect.

8.2 Push Notification Queue

The push notification queue sends push notifications to Wallet Instances through the push notification service of the Mobile Platform Provider (MPP).

The producer is the MDVM, as its Revoke Account operation requires sending push notifications for both user-initiated and MDVM-initiated revocation. The PNS is the consumer of the events and executes its Send Push Notification operation to deliver the notification to the MPP. A push notification event contains the mdvm_wi_id, a timestamp and an instruction for the WI to check it's revocation status (further instructions may be added in the future).

The processing of push notification is idempotent, as resending the notification to the WI only retriggers the instruction for the WI. The queue provides a retry mechanism in case of the MPP not being available, unacknowledged events are redelivered instead of each publishing operation implementing its own mechanism.

8.3 Purge Queue

The purge queue propagates the deletion of the accounts of Wallet Instances that exceeded the data retention period, see backend deletion.

The MDVM is the only producer, as it is the backend that maintains the last-seen timestamp of a Wallet Instance and therefore evaluates the retention period. It publishes one purge event per affected Wallet Instance to the queue. All four backends (WPB, MDVM, RWSCA and PNS) are consumers of the purge queue and execute their respective Purge Account operations (WPB, MDVM, RWSCA and PNS) to delete all data of the affected accounts. A purge event contains the mdvm_wi_id and a timestamp.

The processing of purge events is idempotent, as the deletion of an already deleted account has no further effect. Every backend, including the MDVM as the producer of the events, consumes all purge events and executes its Purge Account operation. The backends delete their accounts independently from each other, as the operations are internal and the Wallet Instance is not involved.