-
Notifications
You must be signed in to change notification settings - Fork 518
Adding initialVisibilityDelay option to Azure Storage Queue binding #3820
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
…omponent Signed-off-by: Will Velida <[email protected]>
@@ -54,7 +55,7 @@ type consumer struct { | |||
// QueueHelper enables injection for testnig. | |||
type QueueHelper interface { | |||
Init(ctx context.Context, metadata bindings.Metadata) (*storageQueuesMetadata, error) | |||
Write(ctx context.Context, data []byte, ttl *time.Duration) error | |||
Write(ctx context.Context, data []byte, ttl *time.Duration, initialVisibilityDelay *time.Duration) error |
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.
If this value is passed as a parameter but isn't expected to change dynamically, I suggest making it a struct property in the types that implement this interface.
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.
After setting the default value to 0, I was thinking that if we keep it as a parameter, consumers can configure it on a per-message basis and it keep some consistency with the ttl
parameter. I'm also think that using a struct here could introduce race conditions with the binding.
…ests and formatting metadata Signed-off-by: Will Velida <[email protected]>
Description
This PR implements the
initialVisibilityDelay
option for Azure Queue Storage Binding. This feature allows setting a delay before a message becomes visible in the queue after being added, which is a functionality available in the Azure Storage Queue service.The implementation includes:
InitialVisibilityDelay
field to thestorageQueuesMetadata
struct with appropriate mapstructure tagsQueueHelper
interface to include the initialVisibilityDelay parameter in the Write methodAzureQueueHelper.Write
implementation to use the initialVisibilityDelay parameter when calling EnqueueMessageAzureStorageQueues.Invoke
method to extract initialVisibilityDelay from request metadataTestWriteWithInitialVisibilityDelay
that verifies the initialVisibilityDelay parameter is correctly passed from the request metadata to the Write methodIssue reference
This PR will close #3555
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: