Skip to content

5.0.0

Choose a tag to compare

@VincentH-Net VincentH-Net released this 04 Oct 16:38
· 6 commits to main since this release
00d2390

Version 5.0 lets you use the regular Orleans streaming API on tenant streams: once you have a tenant stream, you subscribe, resume and unsubscribe exactly as you do with Orleans streams. It requires Orleans 10.4.

For how to upgrade, see Upgrade from 4.x to 5.0 in the readme.

Breaking changes

The breaking changes are limited to tenant streams and to the required Orleans version. Tenant grains, grain calls, cross-tenant authorization and tenant storage work as in 4.0.

  • Orleans 10.4.0 or later is required. 4.0 required Orleans 10.0.1 or later.
  • Subscription handles are regular Orleans handles. TenantStream<T>.SubscribeAsync and GetAllSubscriptionHandles return StreamSubscriptionHandle<T> instead of StreamSubscriptionHandle<TenantEvent<T>>. Where you declared the handle type, change it accordingly. TenantEvent<T> is no longer public. The serialized form of stream events is unchanged.
  • A handle that 4.x stored in grain state cannot be read. If your application stored a subscription handle in grain state with 4.x and you only change the type of the state member, the grain state fails to load and the grain cannot be activated. Give the state member a new name and a new [Id], and get the handle from GetAllSubscriptionHandles() when the grain is activated. The subscriptions themselves are not affected; they continue to work after the upgrade.
  • onNextAsync handlers get a nullable token. Like the Orleans SubscribeAsync methods since Orleans 10.3, the delegates take a StreamSequenceToken?. With nullable reference types enabled, declare the token parameter of your handler as StreamSequenceToken? to avoid warning CS8622.
  • GetStream<T>(namespace, keyWithinTenant) takes the key as it is. It no longer accepts a key that includes the tenant ID. If you passed such a key (for example this.GetPrimaryKeyString() in a grain with an implicit subscription), pass this.GetKeyWithinTenant() instead, or use GetStream<T>(StreamId), which still accepts it.
  • A stream filter must be registered inside AddMultitenantStreams. Registering a stream filter for the provider after AddMultitenantStreams now fails silo startup with an OrleansConfigurationException. In 4.0 this silently disabled tenant separation for that stream provider.

New

  • Resume subscriptions with the Orleans API. ResumeAsync on a handle, with an observer or with delegates, works for subscriptions to tenant streams. This makes it possible to resume explicit subscriptions when a grain is reactivated, as Orleans prescribes.
  • Implicit subscriptions with IStreamSubscriptionObserver. Use handleFactory.CreateTenantHandle<T>() in OnSubscribed; it is the tenant aware equivalent of handleFactory.Create<T>().
  • Handles can be stored in grain state, to resume a subscription with the stored handle.
  • More ways to subscribe. SubscribeAsync now also takes batch delegates, and a StreamSubscriptionStartPosition to start at the latest or at the earliest available event (new in Orleans 10.4).
  • Stream filters. A stream filter that is registered in the addStreamProvider function of AddMultitenantStreams is applied to events that were sent with the tenant aware API; it receives the events as they were sent.
  • Any string is a valid stream key within a tenant, as it already was for grain keys.
  • Storage providers with extra constructor parameters, such as Azure Blob Storage: when a tenant storage provider cannot be created, the exception now explains that getProviderParameters can supply these parameters, and the readme has an Azure Blob Storage example (#15).

The readme has examples for subscribing, resuming and stream filters.

Fixed

  • TenantStream<T>.OnNextBatchAsync threw an InvalidCastException.
  • StreamId.GetTenantId() returned an incorrect value.
  • GetStream<T>(namespace, keyWithinTenant) threw an ArgumentException, or returned a stream with a different key, when the key contained the | character.
  • A stream filter that was registered in addStreamProvider was silently ignored.

Commits

  • 7c358d8 Update editorconfig to Version 20260205 - C# 14; bump nuget version
  • 16b356d Update README with agentic engineering support info
  • c6d3b93 Update README
  • 7e4bf83 update with agentic.check 2.4.1
  • 0e4c2be Version 5.0: transparent stream subscription handles, stream filters, stream keys
  • d97d838 Target Orleans 10.4.0: subscription start positions, nullable annotations
  • ea71cc8 Keep the multitenant-local NuGet feed folder in git, re-enable the feed
  • 6f72792 README: stream samples for 5.0, current Azure Table storage sample
  • 50b1769 Explain getProviderParameters when a tenant storage provider cannot be created
  • 6498986 Generate the release notes link in the NuGet readme from PackageVersion
  • 1958e52 update code in readme screenshot
  • bdb6cda Example: Orleans.Multitenant 5.0.0, latest dependencies, in-memory storage fallback

Merged with #16.

Full Changelog: 4-0-0...5-0-0