Skip to content
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

ASB - allow creating of topics/subscriptions to be optional #1444

Closed
penderi opened this issue Mar 18, 2021 · 15 comments
Closed

ASB - allow creating of topics/subscriptions to be optional #1444

penderi opened this issue Mar 18, 2021 · 15 comments

Comments

@penderi
Copy link
Contributor

penderi commented Mar 18, 2021

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Cloud hosting typically leaves infra concerns (topuic/subscription creation) to be outside of the scope of a component or service. Moreover reduced-rights deployment means attempts to create will fail.

Add the ability to ASB transport to only create topics and subscriptions when specified. Default = allow (as current)

mentioned in #1438

@preardon
Copy link
Member

@penderi @iancooper I'll have a PR in for this in ~30 minutes

@iancooper
Copy link
Member

@preardon Guessing you have seen the optional creation enum on the V9 publication and subscription?

@preardon
Copy link
Member

@iancooper I have not, I was just adding creation Booleans to AzureServiceBusConfiguration as I figured I would keep this confined to ASB Config. I can have a look to wire it up to the over arching config if you like

@iancooper
Copy link
Member

@preardon So on Subscription https://github.com/BrighterCommand/Brighter/blob/master/src/Paramore.Brighter/Subscription.cs and Publication https://github.com/BrighterCommand/Brighter/blob/master/src/Paramore.Brighter/Publication.cs we have an enum OnMissingChannels that indicates what you want us to do:

  • Assume - don't validate or create, it's there trust me (low latency)
  • Validate - check its there, if not raise a channel failure
  • Create - create it

We assume for create producer creates channel (topic, routing key) but client creates queues etc.

That gets passed into your producer or consumer, and the code there has to do the work to determine what to do. When may vary. So with RMQ because it is a no-op if it exists and low-latency the Channel checks when it is called, but in AWS the ChannelFactory does it, not the Channel, because creation is high latency and we need to check if something exists before we create it.

So you have to think about where as well. I'm guessing that ASB is a REST API for creation, so it might make sense to look at the ChannelFactory in the same way AWS does

@iancooper
Copy link
Member

  • @penderi and @preardon Please make sure you are talking so we don't have two folks trying to fix the same issue :-D

@penderi
Copy link
Contributor Author

penderi commented Mar 18, 2021

@iancooper don't worry @preardon is a mate at Flagstone, all good.

holytshirt pushed a commit that referenced this issue Mar 19, 2021
@holytshirt
Copy link
Member

Let me know if you happy to close this now @iancooper

@iancooper
Copy link
Member

@holytshirt Going to look shortly

@iancooper
Copy link
Member

@holytshirt I just wanted to check on the following. Forwarding my comments from the PR:

@preardon So the only thing that might be missing is that the consumer doesn't check for the topic and create it if asked to create. I don't know enough about the management wrapper to know if that will automatically check for the topic and create it, if it is missing, but it would probably need that if not. The consumer tends to check for everything - the producer only the topic.

@iancooper
Copy link
Member

If it subscription doesn't check for/auto-create the topic, we'll need a PR to fix that before we can close this issue.

@preardon
Copy link
Member

@iancooper I will have a look and report back

@preardon
Copy link
Member

@iancooper Have confirmed, does not AutoCreate Topic, PR Incoming

iancooper added a commit that referenced this issue Mar 19, 2021
Check if Topic Exists before creation Subscription #1444
@preardon
Copy link
Member

Was doing some testing and found that I missed plumbing a part, PR incoming

preardon added a commit to preardon/Brighter that referenced this issue Mar 27, 2021
preardon added a commit to preardon/Brighter that referenced this issue Mar 27, 2021
@preardon
Copy link
Member

@iancooper Hey Mate, was looking deeper into this tonight, the error that ends up getting thrown on Channel Failure due to not Topic / Subscription Not existing ends up being "Could not receive message. Note that should return an MT_NONE from an empty queue on timeout" (MessagePump Line 89), Just wanted to get your opinion on this as while the original Error with reason gets swallowed, it'll be logged but there is no hint of the exact reason in the Final exception

iancooper added a commit that referenced this issue Mar 29, 2021
Plumbed Channel Creation Mode into the Factories #1444
@preardon
Copy link
Member

@iancooper I think we can close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants