Skip to content

Commit c7fe17d

Browse files
committed
Minor changes.
1 parent a94ad39 commit c7fe17d

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

SAMtemplates/messaging/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Resources:
113113
MessageRetentionPeriod: 86400 # 1 day in seconds
114114
RedrivePolicy:
115115
deadLetterTargetArn: !GetAtt PostDatedNotificationsDeadLetterQueue.Arn
116-
maxReceiveCount: 13 # processed every 6 hours for 3 days, plus one for the first time it's placed on queue.
116+
maxReceiveCount: 166 # 999 hours / 6 hours
117117
VisibilityTimeout: 300
118118

119119
PostDatedNotificationsDeadLetterQueue:

packages/common/commonTypes/src/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ export interface PostDatedNotifyDataItem extends NotifyDataItem {
3434
LineItemID: string
3535
}
3636

37+
/**
38+
* The structure of a single SQS message in a batch send.
39+
* I couldn't find this type exported from the SDK, and the Message type that IS exported is for receiving data,
40+
* not sending it.
41+
*
42+
* So, I've just done it myself. These are the core attrtibutes we use.
43+
*/
44+
export interface SQSBatchMessage {
45+
Id: string
46+
MessageBody: string
47+
MessageDeduplicationId: string
48+
MessageGroupId: string
49+
MessageAttributes: {[key: string]: {DataType: string; StringValue: string}}
50+
}
51+
3752
/**
3853
* The fields stored in the Notifications table potentially updated by the Notify callback.
3954
*/

packages/updatePrescriptionStatus/src/utils/sqsClient.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@ import {
88
NotifyDataItem,
99
PostDatedNotifyDataItem,
1010
PSUDataItem,
11-
PSUDataItemWithPrevious
11+
PSUDataItemWithPrevious,
12+
SQSBatchMessage
1213
} from "@psu-common/commonTypes"
1314

1415
import {checkSiteOrSystemIsNotifyEnabled} from "../validation/notificationSiteAndSystemFilters"
1516

16-
type SQSBatchMessage = {
17-
Id: string
18-
MessageBody: string
19-
MessageDeduplicationId: string
20-
MessageGroupId: string
21-
MessageAttributes: {[key: string]: {DataType: string; StringValue: string}}
22-
}
23-
2417
const sqsUrl: string | undefined = process.env.NHS_NOTIFY_PRESCRIPTIONS_SQS_QUEUE_URL
2518
const postDatedSqsUrl: string | undefined = process.env.POST_DATED_PRESCRIPTIONS_SQS_QUEUE_URL
2619

0 commit comments

Comments
 (0)