Call service via remoting V1 with Microsoft.ServiceFabric.Services.Remoting 3.2.162

812 views Asked by At

I've multiple services using remoting V1 and new services with V2_1.

Calling the V2_1 services from a asp.net core 2.1 application using Microsoft.ServiceFabric.Services.Remoting version 3.2.162 is no problem. But I cannot call the "old" V1 services, because it tries to connect via V2_1. The first time it throws an exception:

NamedEndpoint 'V2_1Listener' not found in the address '{"Endpoints":{"":"DESKTOP-XX:33016+086fcdfa-9eba-49e0-8953-6fae844d8cf0-131779318708109471-d1b542d1-71bb-40a8-b22d-d0aabc9f4f5c"}}' for partition '086fcdfa-9eba-49e0-8953-6fae844d8cf0'

And the second time it hangs, and usages a lot of CPU usages.

The workaround creating a custom ServiceProxyFactory is not working anymore because the namespace Microsoft.ServiceFabric.Services.Remoting.V1 is remove in 3.2.162

So I decided to upgrade a V1 service with added a extra V2_1 listener, following the upgrade steps. But again after coping this line:

 [assembly: FabricTransportServiceRemotingProvider(RemotingListenerVersion = RemotingListenerVersion.V2_1 | RemotingListenerVersion.V1, RemotingClientVersion = RemotingClientVersion.V2_1)]

RemotingListenerVersion.V1 is not found.

I cannot simple change the V1 listener to V2_1 because other services are depending on it.

What should I do? Is it possible to use V1 and V2_1 altogether? I'm a bit confused here.

1

There are 1 answers

0
Thieme On BEST ANSWER

Service Fabric Remoting V2 is not supported in .NET Core. I can't believe that it is not documented.

In my case, I had a domain project targeting .NET Standard 2.0, and the service project was referencing that package and targeting .NET 4.6.2.

Therefore, I changed the migration plan:

  1. Made sure the domain/interface projects are targeting a full .NET framework, e.g., .NET 6.4.2
  2. Added a V2_1 listener next to the current V1 listener.
  3. Updated all the clients, so they are using V2_1
  4. Removed the V1 listener and switched our project back to .NET Standard