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

RabbitMQ topic name contains numbers will cause exception #181

Closed
someOfsun opened this issue Aug 13, 2018 · 2 comments

Comments

@someOfsun
Copy link

commented Aug 13, 2018

Question

topic交换机routingKey如果含有数字,会提示以下异常(消息仍能正常到达路由绑定的队列):
DotNetCore.CAP.Internal.SubscriberNotFoundException: message can not be found subscriber, Message:name:StoreOnline.topic.user.@5b6be0e28bfa3c111cdc5be6, group:StoreOnline.queue.system。。。

问题场景描述:用户注册后,自动创建一个路由规则及用户队列,路由包含用户ID(字母和数字组成),通过topic路由发布的消息,后台和订阅消息的用户都能收到相应的消息。

如果routingKey全由字母组成,没有任何异常,消息正常到达队列

@yang-xiaodong

This comment has been minimized.

Copy link
Member

commented Aug 17, 2018

thanks for your feedback, I will check it later

@yang-xiaodong yang-xiaodong changed the title rabbitmq topic路由含有数字会报错 RabbitMQ topic name contains numbers will cause exception Aug 21, 2018

@yang-xiaodong

This comment has been minimized.

Copy link
Member

commented Oct 5, 2018

@someOfsun I can't reproduce your exception, below is my subscription code, they can received normally.

[Route("~/without/transaction")]
public async Task<IActionResult> WithoutTransaction()
{
    await _capBus.PublishAsync("topic.user.@5b6be0e28bfa3c111cdc5be6", DateTime.Now);

    return Ok();
}

 [CapSubscribe("topic.user.@5b6be0e28bfa3c111cdc5be6")]
public void SubscriberTest(DateTime time)
{
    Console.WriteLine($@"{DateTime.Now}, Subscriber invoked, Sent time:{time}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.