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?
Related
I have created a sample play framework api which has one endpoint.
http://play-demo-broker.cfapps.io/say?number=20
Which just return me number that have passed.
I am able successfully deploy the service. Next want this service to Act like service broker
For same want to register this as by using below command
cf create-service-broker play-demo-broker admin admin http://play-demo-broker.cfapps.io --space-scoped
This command it giving me below error -
The service broker rejected the request. Status Code: 404 Not Found
Not sure what is causing this issue as there not much information available for Play Framework Service broker Setup.
The play framework is implemented above the akka packages. Akka rejects paths that are not implemented.
If I an not mistaken, cf create-service-broker command access the / endpoint. If you implemented only say?number=20 endpoint, then be default all other paths, such as the empty path, are rejected by Akka.
In order to open that endpoint you need to add it into the routes.
For example you can add:
GET / controllers.ControllerName.GetEmptyPath
And implement the GetEmptyPath method in ControllerName
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
I'm trying to run some of the examples from here. They're configured to access localhost:44333 - if I run one of the examples, e.g. JavascriptResourceOwner, the calls to that address are not getting any response. What project/solution should I be running on that port?
You should run IdentityServer in separate solution for example from example
IdentityServer3.AspNetIdentity
All client samples are designed to be run with the core project host:
https://github.com/IdentityServer/IdentityServer3
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.
I am using AppFabric 1.1 in IIS 7.5 on windows 7 machine to host my Workflows as service. Though I am able to see System endpoints and Application Default endpoints in AppFabric dashboard in IIS, I am not able to see my endpoints that I defined in Web.config file of the application.Also when I add Service Reference in my client projects, I can only see default endpoint configuration values provided by AppFabric. It appears that AppFabric is ignoring <'Service'> tag values in application's web.config file.What could be the reason? Is there something I might have missed ? Any suggestions are greately appreciated.
Thanks
I found the answer. When I changed the service name (in service tag element) exactly as it is in appfabric dashboard for the service, the application endpoints are showing up.