-
-
Notifications
You must be signed in to change notification settings - Fork 350
Add configurable UUID conversion for non-AWS SQS-compatible services #1433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
accessor.setHeader(SqsHeaders.SQS_AWS_MESSAGE_ID_HEADER, source.messageId()); | ||
MessageHeaders messageHeaders = accessor.toMessageHeaders(); | ||
logger.trace("Mapped headers {} for message {}", messageHeaders, source.messageId()); | ||
return new MessagingMessageHeaders(messageHeaders, UUID.randomUUID()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a random UUID does not feel right. Perhaps MessagingMessageHeaders
can have id set as String instead of UUID
? cc @tomazfernandes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! Updated to generate UUID from Message ID instead of random UUID.
Hey @jm0514, thanks for the PR!
@maciejwalkowiak, the issue there is that the Might be worth raising with the Spring Messaging team? In the meantime, I think we can make the solution simpler if we leverage the fact that most ID-related operations are made through the Instead of requiring a configuration change to support other ID types, we could simplify the logic by trying to parse the UUID, and if it fails we add the new header as suggested in the PR. Then in the The caveat would be that for non UUID ids, the result from getting the ID header directly would be a random UUID, but I don't think there's a way around it with the existing What do you folks think? |
Add configurable UUID conversion for non-AWS SQS-compatible services
📢 Type of change
📜 Description
Added configurable support for SQS-compatible cloud services (like Yandex Message Queue) that use non-UUID MessageId formats. The framework now supports both UUID and non-UUID MessageId handling through a new configuration option.
Configuration:
💡 Motivation and Context
Solves #814
💚 How did you test it?
SqsHeaderMapper
andMessageHeaderUtils
📝 Checklist
🔮 Next steps