Autosubscriber and global topics
See original GitHub issueI believe I found a bug in the AutoSubscriber
class. I need all consumers to have the same topic, and in order to achieve that I’m using the following code:
var subscriber = new AutoSubscriber(bus, "subscription-id")
{
ConfigureSubscriptionConfiguration = config => config.WithTopic("my.topic")
};
That seems to do the trick: EasyNetQ effectively uses the same topic to bind all queues to their exchanges. But, it also creates another binding using the #
wildcard, which renders the other one useless - as far as my knowledge on RabbitMQ and EasyNetQ goes.
I was able to track down the problem to this method:
private Action<ISubscriptionConfiguration> TopicInfo(AutoSubscriberConsumerInfo subscriptionInfo)
{
var topics = GetTopAttributeValues(subscriptionInfo);
if (topics.Count() != 0)
{
return GenerateConfigurationFromTopics(topics);
}
return configuration => configuration.WithTopic("#");
}
If a consumer doesn’t have any ForTopic
attributes applied on it, the #
wildcard will be used - which makes sense most of the time, but not when a “global” topic is already defined.
Am I correct to think this is a bug? If it is, I can try to fix it and send a PR.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to write an EasyNetQ auto subscriber dispatcher for ...
So, the EasyNetQ auto subscriber has a basic default dispatcher that cannot create message consumer classes with non-parameterless constructors.
Read more >Publish and receive messages in Pub/Sub by using a client ...
A subscriber client creates a subscription to that topic and consumes messages ... an account to evaluate how our products perform in real-world...
Read more >How do I turn off automatic notification subscription for new ...
Go to your profile settings; Click Notification Center; Uncheck Automatically watch repositories.
Read more >Create a YouTube Auto Subscribe Link for Your Channel
YouTube auto-subscribe link is essential for driving traffic to your YouTube channel. This article explains how the link will help boost the rate...
Read more >[Question] Did the Auto-Subscribe URL Trick Stopped ...
I noticed that this trick no longer works as of this month. This thread is archived. New comments cannot be posted ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@micdenny Nice idea. It makes sense for me and this change sounds good for v7 version.
It seems to be fixed in #1198.