Skip to content

Upgrade to SQS AWS SDK v2#28337

Merged
ioannakok merged 3 commits intomainfrom
aws-sdk-v2-sqs
Nov 11, 2025
Merged

Upgrade to SQS AWS SDK v2#28337
ioannakok merged 3 commits intomainfrom
aws-sdk-v2-sqs

Conversation

@ioannakok
Copy link
Contributor

@ioannakok ioannakok commented Oct 31, 2025

Closes #26516

Background

There are two queues in the fronts architecture:

  1. FrontPressCron. It receives notifications from the RefreshFrontsJob in the admin app on a cron schedule.
  2. ToolPressQueueWorker. It receives press jobs from the fronts tool whenever a front gets updated.
image

See more about fronts architecture here

What does this change?

This PR updates the code for these two queues to AWS SDK v2.

Why?

AWS SDK v1 reaches end-of-support on 31 of December

Screenshots

Front pages are successfully pressed both when the cron job triggers them and when they are changed from the Fronts Tool.

Before After
image image

Checklist

  • Tested locally, and on CODE if necessary
  • Will not break dotcom-rendering

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

ioannakok and others added 2 commits November 5, 2025 15:30
Co-authored-by: Marjan Kalanaki <marjan.kalanaki@guardian.co.uk>
@ioannakok ioannakok added AWS SDK v2 Upgrading to AWS SDK v2 https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html maintenance Departmental tracking: maintenance work, not a fix or a feature labels Nov 6, 2025
if (Configuration.environment.stage == "CODE") {
logInfoWithCustomFields(
s"Pressed data for front $path : ${Json.stringify(Json.toJson(pressedFronts.full))} ",
s"Pressed data for front $path",
Copy link
Contributor Author

@ioannakok ioannakok Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging the entire front JSON was making facia-press logs unusable and I was not able to test my changes.
Logs were too big and it was impossible to select a larger than a few minutes time range. The response was larger than the allowed size

image

In a following PR I will delete this entire block of code.

if (Configuration.environment.stage == "CODE") {
logInfoWithCustomFields(
s"Pressed data for front $path : ${Json.stringify(Json.toJson(pressedFronts.full))} ",
customFields = List(
LogFieldString("messageId", messageId),
LogFieldString("pressPath", path),
),
)
}


def run(): Future[Unit] = {
if (R2PagePressServiceSwitch.isSwitchedOn) {
log.info("R2PagePressJob starting")
Copy link
Contributor Author

@ioannakok ioannakok Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really doubt this job is doing anything so I haven't been able to test it successfully. By looking at the code, R2PagePressNotifier publishes SNS notifications and pushes jobs to two queues. There's one for re-pressing R2 pages and one for taking them down. R2PressPageJob listens to the queues and performs the operation.

I tried to re-press an R2 page in PROD and

  1. I can't see any of these logs.
  2. The S3 object for the pressed page is not in the bucket.

I haven't tested the takedown path because this is done by CP when they publish the old R2 articles in Composer and results in 404 for the old url.

I propose we ignore this for the purposes of this PR and maybe remove any unnecessary infrastructure from R2 pressing. We've discussed in the past that just pressing and putting in the bucket should be enough.

@ioannakok ioannakok marked this pull request as ready for review November 6, 2025 15:27
@ioannakok ioannakok requested a review from a team as a code owner November 6, 2025 15:27
Copy link
Contributor

@DanielCliftonGuardian DanielCliftonGuardian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟

@ioannakok ioannakok merged commit 27631fa into main Nov 11, 2025
9 checks passed
@ioannakok ioannakok deleted the aws-sdk-v2-sqs branch November 11, 2025 10:13
@gu-prout
Copy link

gu-prout bot commented Nov 11, 2025

Seen on ADMIN-PROD (merged by @ioannakok 9 minutes and 56 seconds ago)

@gu-prout
Copy link

gu-prout bot commented Nov 11, 2025

Seen on FRONTS-PROD (merged by @ioannakok 11 minutes and 7 seconds ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AWS SDK v2 Upgrading to AWS SDK v2 https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-ADMIN-PROD Seen-on-FRONTS-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AWS-SDK v2: SQS

2 participants