orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Cannot configure MessagingOptions.ResponseTimeoutWithDebugger via builder extension methods

Open berdon opened this issue 8 years ago • 4 comments

Perhaps I simply can't find the means but it doesn't seem possible to use either the legacy ClientConfiguration or a new method to set MessagingOptions.ResponseTimeoutWithDebugger. The "Messaging" option in client configuration .xml's are from MessagingConfiguration which doesn't support the field.

As a workaround, I am simply post configuring the ClientMessagingOptions:

var client = new ClientBuilder()
    .UseConfiguration(config)
    .ConfigureApplicationParts(appParts =>
    {
        appParts.AddFromApplicationBaseDirectory().WithReferences();
        appParts.AddFromAppDomain().WithReferences();
    })
#if DEBUG
    .ConfigureServices(s => s.PostConfigure<ClientMessagingOptions>(options => options.ResponseTimeoutWithDebugger = TimeSpan.FromSeconds(15)))
#endif
    .Build();

berdon avatar Jun 06 '18 16:06 berdon

Hi Configure ResponseTimeoutWithDebugger through ClientMessagingOption is the correct way. MessagingOptions is the common base class for ClientMessagingOptions and SiloMessagingOptions. But itself shouldn't be used as options/configuration directly. Because one it is an abstract class, so compile wise, call Configure<MessagingOptions> on it would cause compile errors I believe. two we use ClientMessagingOptions and SilOMessagingOptions in our code, configure MessagingOptions won't make changes to either of these two options.

So this is not a bug. With that being said, whether the existence of MessagingOptions is confusing or not is another question. Welcome to share some feedback .

xiazen avatar Jun 06 '18 22:06 xiazen

Are you saying .Configure() is the suggested way of configuring those options? I used .ConfigureServices(s => s.PostConfigure(... in case you guys were actually configuring it yourself internally.

Presumably, MessagingConfiguration is a remnant of the xml configuration work that is deprecated so I'm not expecting that way to work anymore. I'm just looking for guidance on how you would expect these fields to be configured.

berdon avatar Jun 07 '18 18:06 berdon

no, PostConfigure is fine, I just wanted to point out configure through MessagingOptions isn't right. Configure through ClientMessagingOptions or SiloMessagingOPtions is the suggested way. Does this make sense?

I got the sense from you that you expect configure through MessageingOtions to work, and suspect it is a bug when it didn't work. Please correct me if I got your intension wrong.

xiazen avatar Jun 13 '18 23:06 xiazen

closing due to inactivity. Feel free to reopen if there's further issues

xiazen avatar Jun 26 '18 19:06 xiazen