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

Queue peek settings don't work #1026

Open
DavidBoike opened this issue Jun 29, 2022 · 0 comments
Open

Queue peek settings don't work #1026

DavidBoike opened this issue Jun 29, 2022 · 0 comments

Comments

@DavidBoike
Copy link
Member

The documentation for SQL Transport Design mentions queue peek settings, but these settings don't currently work. Further, the situation described in the blog post for the feature doesn't actually work either.

In v6.3.3 (current at the moment), the FormatPeekCommand method the peek command is formatted using Format(SqlConstants.PeekText, qualifiedTableName, maxRecordsToPeek), but in SqlConstants the peek text being formatted is SELECT isnull(cast(max([RowVersion]) - min([RowVersion]) + 1 AS int), 0) Id FROM {0} WITH (nolock) which does not include a {1}. So the value returned will always be roughly the number of messages in the queue, regardless of queue peek settings.

The assumption was probably that queue peek settings would be the maximum returned by the peek query, but the query was changed in this commit from SELECT count(*) Id FROM (SELECT TOP {1} * FROM {0} WITH (READPAST)) as count_table; because it has much better performance.

In the MessagePump class (in V7 this will be renamed to MessageReceiver) the message count is used as a ceiling for maximumConcurrentReceives but since the peek options are not honored, this will always be the approximate size of the queue, without regard for the queue peek limit. While the concurrencyLimiter does ensure that the endpoint concurrency settings are respected, the queue peek limit is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants