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

BasicConsumeAsync throws when FromQueue("QueueName") is not specified #206

Closed
cemremengu opened this issue Mar 22, 2017 · 2 comments
Closed
Assignees
Milestone

Comments

@cemremengu
Copy link
Contributor

This works:

await _busFactory.Create().BasicConsumeAsync(async args =>
{
//code here
},
ctx => ctx.UseConsumerConfiguration(
	cfg => cfg.Consume(c => c
			.FromQueue("MyQueueName")
			.WithPrefetchCount(350)
			.WithRoutingKey("gsm.cell.kpi"))
		.OnDeclaredExchange(e => e
			.WithName("abid.kpi")
			.WithType(ExchangeType.Topic))));

But if the .FromQueue("MyQueueName") is omitted it will throw a cryptic exception String reference not set to an instance of a String. Parameter name: s

This is probably caused by https://github.com/pardahlman/RawRabbit/blob/2.0/src/RawRabbit/Consumer/ConsumerFactory.cs#L54-L62

when a mandatory config is not specified

@pardahlman
Copy link
Owner

The question, though, is - if you don't say from which queue to consume from, how will we know which queue to consume from :)

@pardahlman
Copy link
Owner

I agree with you, though, that RawRabbit could do an argument check and throw a nice error instead of relying on the underlying RabbitMQ.Client exception.

@pardahlman pardahlman added this to the 2.0.0 milestone Mar 22, 2017
@pardahlman pardahlman self-assigned this Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants