fix: extract region from ARN for cross-region SQS delivery#86
fix: extract region from ARN for cross-region SQS delivery#86tbashiyy wants to merge 1 commit intofloci-io:mainfrom
Conversation
…ntBridge and S3 EventBridge and S3 were using the 3-argument sendMessage overload which defaults to the emulator's default region, ignoring the region in the target SQS ARN. This caused cross-region SQS delivery to fail with NonExistentQueue errors. Now both services extract the region from the ARN and pass it to the region-aware sendMessage overload, consistent with how Lambda and SNS targets are already handled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hi @tbashiyy, thanks for taking the time to contribute! We've seen your PR and will take a look soon. To ensure this implementation stays robust, could you also open a PR in our compatibility suite at https://github.com/hectorvent/floci-compatibility-tests? This helps us validate that your changes keep working perfectly as the project evolves. The Floci team |
…ests Validate that EventBridge and S3 notifications correctly deliver messages to SQS queues in a different region (eu-west-1) when the target ARN specifies a non-default region. Covers the fix in floci-io/floci#86. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hectorvent
left a comment
There was a problem hiding this comment.
Hello @tbashiyy,
Thanks for the PR!
Could you please update the commit history to remove the Co-authored-by: Claude <...> line from the commit message? We prefer to keep the attribution focused on human contributors for this project. Once that's cleaned up, I'm happy to take another look!
|
Closing this PR as it is already fixed by others PRs. Thanks @tbashiyy |
Summary
EventBridge and S3 were ignoring the region in SQS target ARNs when delivering messages, always using the emulator's default region. This caused cross-region SQS delivery to fail with
NonExistentQueueerrors.Both services now extract the region from the ARN and pass it to the region-aware
sendMessageoverload, consistent with how Lambda and SNS targets are already handled.Affected code paths:
EventBridgeService.invokeTarget— SQS branch (line 420)S3Service.fireNotifications— queue notification loop (line 1027)Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Incorrect behavior:
EventBridgeService.invokeTargetandS3Service.fireNotificationscalledsqsService.sendMessage(queueUrl, payload, 0)(3-arg overload), which internally defaults toregionResolver.getDefaultRegion(). When the SQS target ARN specified a different region (e.g.arn:aws:sqs:eu-west-1:...), the message was sent to the wrong regional queue store, resulting inNonExistentQueueerrors.Other service integrations (SNS→SQS, EventBridge→Lambda, EventBridge→SNS) already extract the region correctly — only the two SQS paths were missing this.
Checklist
./mvnw testpasses locally