FabricInvalidAddressException: NamedEndpoint 'V2Listener' when trying to connect from .NET Core application - azure-service-fabric

I'm am trying to connect to a Service Fabric application using the ServiceProxy class like so:
return ServiceProxy.Create<ISomeService>(
new Uri("fabric:/SomeService.App/ISomeService"),
new ServicePartitionKey(0));
When I do this from a .Net Framework application everything works fine.
However, when I try this from a .Net Core application I get the following error:
InnerException = {System.Fabric.FabricInvalidAddressException: NamedEndpoint 'V2Listener' not found in the address '{"Endpoints":{"":"..."}}' for partition '...')
I'm assuming this has something to do with V2 remoting, but I can't figure out what exactly it is in the .Net Core project that is defaulting it to use V2 instead of V1.
Is there a way I can force it to use V1 - I'm not in a position to upgrade the target service to V2 at the moment.
All applications involved are using Service Fabric version 6.1.480
Only relevant documentation I can find is Service Fabric Reliable Services Communication Remoting and it hasn't helped me find a solution.

You can only use SF Remoting V2 in .Net Core.
Remoting V1 is supported using Full Framework only. (I agree that the documentation should specify this.)
See this link

Related

Kubernetes .NET Core API can't communicate with services

I'm facing a k8s microservice communication issue. K8S structure as below
Fail case
I try to call service2 from .NET Core API 1 via http://service2:8080 (service2 is the services name) but I get an error.
I tried to use a simple code use HttpClient call google.com which can successfully get response which means not about .net coding issue.
Success cases
I use ingress controller which can let .NET Core API 1 connect to .NET Core API 2.
I also tried login to pod1 and curl http://service2:8080 which can successfully get response from pod2.
It seems the k8s DNS can't recognize http://service2:8080 from .NET Core api1.
Does anyone have an idea about that?

Multiple v2 Service Remoting Endpoints in Service Fabric

I'm using Service Fabric v6.1.472. We're trying to switch to using Service Fabric Remoting (https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication-remoting), specifically to use the v2 listeners.
The problem I'm running in to is that the documentation only says how to do it using a single listener via the extension method:
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
return this.CreateServiceRemotingInstanceListeners();
}
This assumes that
The service class implements the remoting interface
There is only one remoting v2 endpoint in the host (I need multiple endpoints).
When digging into the decompiled code, it looks like this extension method uses a hard-coded endpoint name, which would make it impossible to use this for multiple remoting endpoints. Further digging revealed that many of the methods used by the extension method are marked internal.
Short of creating my own library, has anyone else found a workaround to this bit of bad design?
Edit
Microsoft updated their documentation. Under the header "Using explicit V2 classes to use the V2 stack," it is clear how to create listeners without the extension method.

Detecting Service Fabric upgrade is completed using .NET client

Upgrading an existing SF application using .NET client with FabricClient.ApplicationManagementClient.UpgradeApplicationAsync and getting the status of upgrade using FabricClient.ApplicationManagementClient.GetApplicationUpgradeProgressAsync. Last command returns ApplicationUpgradeProgress with a property UpgradeStatus. I was hoping this enum (ApplicationUpgradeState) based property would have a value of Completed or something similar, but there's nothing like that.
What is the right way to determine (using .NET client) that a given SF application has successfully completed? Is there a callback option?
ApplicationUpgradeState.RollingForwardCompleted

jbpm 6.0.1 create process calling rest

How to create process with 1 service task - rest which calls
http://www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency=EUR&ToCurrency=USD
and sets this value as parameter which can be seen later, using jbpm console(kie workbench)? JBOSS docs are mostly for user tasks.
My recommended solution is to create a new WorkItemHandler implementation that calls the web service get the results and inject that as a process variable.
You can see a similar example that calls web services here: https://github.com/droolsjbpm/jbpm-playground/tree/master/customer-relationships-workitems
HTH
There is a REST service task that you can use, available out-of-the-box in the web-based designer (under service tasks, so implemented as a custom service task). The associated handler should also be registered automatically when using the jbpm-installer:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/conf/META-INF/CustomWorkItemHandlers.conf#L4

Can ASP.NET Web API methods be called from a Windows CE app / CF 3.5?

We were thinking about doing something like WCF / REST - I think the techn[ique,ology] was called ADO.NET Data Services in VS 2008 / .NET 3.5 - anyway, something like a RESTful receiving and transmitting of data from a CF 3.5 app and a desktop .NET 4 app to simplify the client / Windows CE app so that it simply sends and receives XML or JSON data, rather than connecting to a remote database or so.
However, according to Where to start REST web service in C# or ASP.Net:
"REST in WCF no longer supported - now it points to ASP"
From the same link:
"ASP.NET Web API is now the Microsoft framework for creating RESTful services.
http://www.asp.net/web-api"
Okay, I think we can do that (WebAPI) - the plan is to host the server/service in IIS; however: Can ASP.NET Web API methods be called from CF 3.5? Does anybody have examples of such?
As long as CF 3.5 can make http requests, then you should be able to make rest calls. Look for HttpWebRequest in CF.
http://msdn.microsoft.com/en-us/library/aa446517.aspx
Look at Microsoft's article Calling WCF Services.
To create your service, you are going to need to Power Toys for .NET Compact Framework 3.5, then turn around after installing that to Download the New NetCFSvcUtil (that is a direct download).
I've created Batch files that I store in my Services folder of my Windows Mobile Project (that way, I can't lose them). The batch file is like this:
** create.bat **
NetCFSvcUtil.exe /l:cs /o:Employee.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpEmployee.svc?wsdl
pause
NetCFSvcUtil.exe /l:cs /o:Packout.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpPackout.svc?wsdl
pause
That creates 2 Proxy files for me: One for Employees and one for my Packout service. They both create the same base file, ServiceModelBase, which is just a way for services to throw exceptions.
Adding the pause between steps enables you to read any error messages that are thrown up on the screen before running the next command.