Azure Service Fabric ServiceProxy failing silently

Inside my service fabric, I was creating a ServiceProxy to call another part of the fabric which I had working in multiple other places in my code like this:

var uri = new Uri("fabric:/MyNameSpace.MyClass");
var proxy = ServiceProxy.Create<ISomeInterface>(uri);
proxy.DoSomething(someString, someObjectCollection);

And it worked perfectly fine, next I tried with a different interface and it just silently failed, literally the exact same setup, but a new interface.

public interface ISignalRelay : IService
    Task Broadcast(string group, string message, object details);

Then my code:

var uri = new Uri("fabric:/MyNameSpace.MyClass");
var signalRelay = ServiceProxy.Create<ISignalRelay>(uri);
signalRelay.Broadcast(group, message, nonPrimitiveObject);

When stepping through the code, it would work fine until I hit Broadcast() and then just continue on, but that code was never hit.  From what I deduced, it was the ability of the proxy to deal with the base object class when it was passed something that was not a primitive type.

I was able to work around this as I was able to pass in a serialized string version of the object instead, but this is definitely a limitation of the way fabric works.  As an FYI, I tried generics, but you can not use the cross class fabric structure with generics (I forget the actual exception, but it's explicitly stated you cannot).  

If anyone has a way around this, or a better understanding, I would love to hear it.  Otherwise, I hope this saves someone from bashing their head on the desk all day like it did me.


Comments are closed