Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17796

.NET: Services do not work with default interface implementations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.13
    • 2.15
    • platforms
    • .NET: Added support for default interface methods to Services.
    • Release Notes Required

    Description

      The code below throws "InvalidOperationException: Failed to invoke proxy: there is no method 'Greet' in type 'MyService' with 1 arguments"

      using Apache.Ignite.Core;
      using Apache.Ignite.Core.Services;
      
      using var ignite = Ignition.Start();
      
      ignite.GetServices().DeployClusterSingleton("svc", new MyService());
      var svc = ignite.GetServices().GetServiceProxy<IMySvc>("svc");
      Console.WriteLine(svc.Greet("foo"));
      
      public interface IMySvc
      {
          string Greet(object arg) => $"Hello, {arg}!";
      }
      
      class MyService : IService, IMySvc
      {
          public void Init(IServiceContext context) { }
          public void Execute(IServiceContext context) { }
          public void Cancel(IServiceContext context) { }
      }
      

      Attachments

        Activity

          People

            ptupitsyn Pavel Tupitsyn
            ptupitsyn Pavel Tupitsyn
            Igor Sapego Igor Sapego
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m