-
Notifications
You must be signed in to change notification settings - Fork 32
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
Allow BroadwaySQS to work with temporary sessionToken #11
Comments
Thanks for your thoughts on this issue. I'm still new to this codebase, so take my comments with that in mind. What would this
information? if that is the case, I'd prefer (and is likely more general) to receive the old config as a sort of |
The problem with this approach is that you may have multiple producers... so we would need to call the callback with each of config of each producer, which will complicate things. For example, the expiration time would be per producer, so if you want to rely on it, then it means caching between producers won't work. Also, even if you have one producer, the AWS client can be called from many different processes. If you have to pass the So there is a bunch of complexity in making the solution more general because of the nature of the domain. Therefore I would prefer to allow only to return from |
I see. I was too focused on the problem in front of me which only has a single producer (at least for now ;-) and I'm still getting familiar with Broadway. I don't fully see all the subtleties yet, but I trust your judgement. I can achieve what I'm looking for by managing my own state behind my |
I now have a working implementation of my custom SQSClient and can better comment on this issue. Yes a {M, f, a} On the other hand, I also wouldn't mind if the answer to this need is to write a custom SQSClient. It wasn't as daunting as it seemed when I was first learning Broadway. I've used mine to provide some optional parameters that let me simulate more situations in tests. It might be nice if some private functions in the ExAwsCllient were made public, but it's not so complex that it bothers me to re-implement it either. |
This functionality was merged for Google Cloud PubSub, so we would definitely be glad to merge similar PR here: dashbitco/broadway_cloud_pub_sub#29 So a PR is definitely welcome! |
Discussion started here dashbitco/broadway#68.
@gvaughn:
Currently, the only option would be to create a custom SQSClient. However, we believe it would be a good idea to extend the API to allow this, so here's is a first suggestion:
We can provide a new config option for the client called
token_generator
, which is a{M, f, a}
to be called before each receive/delete request. An initial implementation of this generator could be aGenServer
that periodically updates the token (maybe on an:ets
table withread_concurrency: true
?).In case you see other scenarios where we might need to update other config options, we could even consider expanding this concept to a more generic one like
extra_options_generator
that could be used to merge any other option to the config.Thoughts?
The text was updated successfully, but these errors were encountered: