orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Orleans Streams Extensibility: Writing a Custom Queue Adapter for 2.0

Open srinathgnath opened this issue 8 years ago • 3 comments

Team, Please guide me how to implement custom stream provider.

Below documentation doesn't seems to be correct for Orleans 2.0. https://dotnet.github.io/orleans/Documentation/Orleans-Streams/Streams-Extensibility.html

Step 4: as per above link 4. Declare public class MyQueueStreamProvider : PersistentStreamProvider. This is your new Stream Provider.

Thanks

srinathgnath avatar Apr 09 '18 16:04 srinathgnath

below is an example on how to configure silo with custom stream provider, where MyQueueStreamProviderAdapterFactory is the custom IQueueAdapterFactory

              hostBuilder
                        .AddPersistentStreams(StreamProviderName, MyQueueStreamProviderAdapterFactory .Create, b=>b
                        .ConfigureComponent<IStreamQueueCheckpointerFactory>((s, n) => NoOpCheckpointerFactory.Instance)
                        .Configure<StreamStatisticOptions>(ob => ob.Configure(options => options.StatisticMonitorWriteInterval = monitorWriteInterval))
                        .UseDynamicClusterConfigDeploymentBalancer());

As for https://dotnet.github.io/orleans/Documentation/Orleans-Streams/Streams-Extensibility.html. The configuration step probably should be updated, since we don't support configure through XML natively anymore, you need to use IOptions and IConfiguration for that. And step 4 shouldn't be needed anymore, since now the streaming configuration is more componentized. So to configure a custom stream provider, one need to inject the custom QueueAdapterFactory through ISiloPersistentStreamConfigurator or IClusterClientPersistentStreamConfigurator, which eventually feed into DI, compared before it was configured through inheritance.

Thanks for point it out. I will update the docs

xiazen avatar Apr 10 '18 18:04 xiazen

Thanks. That works!

srinathgnath avatar Apr 11 '18 16:04 srinathgnath

Resolved by #10591, which adds the current custom persistent-stream queue adapter guide and compiling example.

ReubenBond avatar Aug 18 '26 16:08 ReubenBond