Skip to content

Add support for Azure Service Bus sessions#829

Merged
yang-xiaodong merged 1 commit intodotnetcore:masterfrom
jonekdahl:service-bus-sessions
Apr 15, 2021
Merged

Add support for Azure Service Bus sessions#829
yang-xiaodong merged 1 commit intodotnetcore:masterfrom
jonekdahl:service-bus-sessions

Conversation

@jonekdahl
Copy link
Contributor

As discussed in #828, this is a PR to add session support for Azure Service Bus.

Adds a new config option EnableSessions for Azure Service Bus. Session support must be explicitly enabled. When disabled, CAP works like before.

When sessions are enabled:

  • RequiresSession is set on auto-created subscriptions
  • The SessionId property is set on the Service Bus Message
    • uses the value of the cap-session-id header, when present
    • otherwise falls back to using the message id (similar to the handling of cap-kafka-key)
  • RegisterSessionHandler is used instead of RegisterMessageHandler when consuming events

There is also some brief documentation on the feature, how to enable and use it (in English, possibly needs translation?).

As we don't use CAP on the consumer side ourselves, this part is unfortunately not well tested.

Suggestions welcome!

Copy link
Member

@yang-xiaodong yang-xiaodong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks

@yang-xiaodong yang-xiaodong merged commit 458b08d into dotnetcore:master Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants