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

[service-bus] (non-sessions) Modify receive algorithm to match .NET. #9968

Merged

Conversation

richardpark-msft
Copy link
Member

@richardpark-msft richardpark-msft commented Jul 8, 2020

Changing our receiveMessages() algorithm to match .NET's.

The new version works like this:

receive(maxMessages, maxWaitTime)

Internally we then wait for:

  1. maxMessages to arrive
  2. maxWaitTime to expire
    or
  3. An internal 1 second timeout that will fire after the first message
    has been received.

TODO:

  • Update the documentation for receiveMessages to describe the new behavior.
  • Add this to the "breaking changes" changelog. It's "minor" if the users are doing continual looping reads but might catch people unaware if they were only doing a single call.

Partial fix for #9718

The new version works like this:
receive(maxMessages, maxWaitTime)

Internally we then wait for:
1. maxMessages to arrive
2. maxWaitTime to expire
or
3. An internal 1 second timeout that will fire _after_ the first message
   has been received.
@richardpark-msft
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

richardpark-msft and others added 4 commits July 10, 2020 10:26
…at mode and not all the messages appear to be recieved
…est timeout between "remaining time for receive" vs "maxTimeAfterFirstMessageInMs"
@richardpark-msft
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

I needed to add an actual implementation for the EventEmitter (I use it in the tests). Just re-running, no code changes.

@richardpark-msft richardpark-msft merged commit 72f74c5 into Azure:master Jul 16, 2020
@richardpark-msft richardpark-msft deleted the richardpark-sb-track2-receive-alg branch July 16, 2020 18:00
richardpark-msft added a commit that referenced this pull request Jul 17, 2020
…sages algorithm (#10107)

[sessions] Changing our receiveMessages() algorithm to match .NET's.

The new version works like this:

receive(maxMessages, maxWaitTime)

Internally we then wait for:

  maxMessages to arrive
  maxWaitTime to expire
  or
  An internal 1 second timeout that will fire after the first message has been received or 
  the remaining time left from maxWaitTime (whichever one is smaller)

(also eliminated some dead code as a result of making SessionManager a sample rather
 than being part of the core library)

Complements #9968 and is the final change for #9718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants