question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autosubscriber and global topics

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Plinercommented, Dec 23, 2020

@micdenny Nice idea. It makes sense for me and this change sounds good for v7 version.

0reactions
Plinercommented, Sep 4, 2022

It seems to be fixed in #1198.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found