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

CapSubscribe allows only Names up to 51 characters #344

Closed
LeonhardFischl opened this issue May 23, 2019 · 5 comments

Comments

@LeonhardFischl
Copy link

commented May 23, 2019

We are using DotNetCore.CAP in combination with Azure service bus.

I determind that event names (CapSubscribe("this name here") does only allow up to 51 characters.
We`ve used it like shown in the code snippet

[CapSubscribe(nameof(SuperLongNameWithMoreThanFiftyCharactersIntegrationEvent))]

If we use it with less than 51 characters it works fine.

Can you fix it that this name is able to have more than 51 characters.
A good idea is the database column size of nvarchar(200) which means it should work with up to 200 characters.

Thanks in advance
Leonhard

@yang-xiaodong

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Hello @LeonhardFischl ,

The length of the CAP name depends on the length of the column fields in the database. I just looked at Azure Service Bus because it limits the length of the Rule Name and you can see the code comments here :
https://github.com/Azure/azure-service-bus-dotnet/blob/dev/src/Microsoft.Azure.ServiceBus/Filters/RuleDescription.cs#L85

@enterprisebug

This comment has been minimized.

Copy link

commented May 27, 2019

It would be absolutely desireable to have a validation for each provider Implementation which validates the event name length.

You have implementation for the different providers, so you could validate each:

  • DotNetCore.CAP.RabbitMQ
  • DotNetCore.CAP.MySql
  • DotNetCore.CAP.Kafka
  • DotNetCore.CAP.SqlServer
  • DotNetCore.CAP.PostgreSql
  • DotNetCore.CAP.MongoDB
  • DotNetCore.CAP.AzureServiceBus
    (max length: 50 chars)
  • DotNetCore.CAP.InMemoryStorage
@yang-xiaodong

This comment has been minimized.

Copy link
Member

commented May 27, 2019

@enterprisebug nice advice, I can make validate in the code ahead of time.

@enterprisebug

This comment has been minimized.

Copy link

commented May 27, 2019

that would improve stability very much. @LeonhardFischl would have saved days finding the problem. Main problem was that the error reg. 50 chars with AzureServiceBus was hidden. We never saw an exception giving us a hint pointing to the event name length.

@yang-xiaodong

This comment has been minimized.

Copy link
Member

commented May 28, 2019

Hello @enterprisebug ,

I have fixed in version 2.5.1-preview-75824665 , because of my azure free account subscription is expired so i can't test it. Any feedback is welcome! :)

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.