1

I am using Service Fabric with .net core with Service Fabric Remoting V2. and I am building a multi-tenant app and I want to add custom header to send the tenant ID automatically.

I have started with the solution for this question which uses normal .net framework with service fabric but in the case of .net core it didn't even compile since the service fabric with .net core has different APIs and Methods.

The code goes as follows and There are many cases for non existing APIs:

The Client

  1. ProxyFactory

var _proxyFactory = new ServiceProxyFactory(c => new ServiceRemotingClientFactoryWrapper(new WcfServiceRemotingClientFactory(callbackClient: c)));

The bold class comes from the Microsoft.ServiceFabric.Services.Wcf package (aside whats said in the nuget site) it is asking me to add a System.ServiceModel Dll which is a full .net library and not even in the stated dependencies.

  1. The ServiceRemotingClientWrapper provided in the solution contains a class named ServiceRemotingMessageHeaders which according to documentation is the in the service remoting class but it doesn't exist. Also the functions in the interface take IServiceRemotingRequestMessage which is different from the aforementioned demo.

The Server

the class ServiceRemotingDispatcher should be in the remoting Dll and yet it doesn't exit.

Finally, This project uses the same methodology to implement my goal and its based on the same SOF question but uses full .net framework and it works. Link to project

Walid Hanafy
  • 1,429
  • 2
  • 14
  • 26
  • .Net Core does not have different afaik api's and methods so please post your actual code (including namespaces) because as it is right now we won't be able to help you. – Peter Bons Jun 01 '18 at 07:38
  • I have enhanced the question and elaborated the problems and differences – Walid Hanafy Jun 04 '18 at 03:14
  • Do you require WCF based remoting? If not, try using the regular remoting client factory: https://learn.microsoft.com/en-us/dotnet/api/microsoft.servicefabric.services.remoting.v2.fabrictransport.client.fabrictransportserviceremotingclientfactory?view=azure-dotnet – LoekD Jun 04 '18 at 05:58
  • 1
    See https://ladeak.wordpress.com/2018/01/14/intercepting-service-fabric-remoting-calls/ – Peter Bons Jun 04 '18 at 07:46
  • If you are interested, I created a NuGet package that provides message interception and custom headers injection. See [the repo](https://github.com/Expecho/ServiceFabric-Remoting-CustomHeaders) – Peter Bons Jun 25 '18 at 06:45
  • Thanks a lot, but what is the difference between the new repo and your [old one](https://www.github.com/DeHeerSoftware/Azure-Service-Fabric-Logging-And-Monitoring) – Walid Hanafy Jun 25 '18 at 13:27
  • The new repo focusses only on custom headers and message interception and is a ready-to-go package you can add to your project using NuGet. The old one contains a lot more. Eventually the old one will have a reference to the new one using NuGet. – Peter Bons Jul 02 '18 at 09:32

0 Answers0