Skip to content

Commit

Permalink
Extract only the supported message attributes for AWS SQS (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsosag committed Jul 22, 2024
1 parent 42f4cd4 commit 4e8e7f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/cli/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ class SQS < Base
def normalize_dump_message(message)
# symbolize_keys is needed for keeping it compatible with `requeue`
attributes = message[:attributes].symbolize_keys

# See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_MessageAttributeValue.html
# The `string_list_values` and `binary_list_values` are not implemented. Reserved for future use.
message_attributes = message[:message_attributes].each_with_object({}) do |(k, v), result|
result[k] = v.slice(:data_type, :string_value, :binary_value)
end

{
id: message[:message_id],
message_body: message[:body],
message_attributes: message[:message_attributes],
message_attributes: message_attributes,
message_deduplication_id: attributes[:MessageDeduplicationId],
message_group_id: attributes[:MessageGroupId]
}
Expand Down

0 comments on commit 4e8e7f7

Please sign in to comment.