It's possible to create one service that calls two proxy-services in loopback 4? - loopback

I have two Rest data sources, with their respective proxy-service.
But can I create one service that calls the right proxy-service instead of doing it directly on the controller? Is that possible?
Thank you so much

At the end, yes it is.
Just create a new service with this option:
enter image description here
And then inject the proxy-services you need. On this way you can delegate some logic from controller to this service.

Related

Assign names to applications without Service Fabric

I have an application in the service fabric and I'm going to upload another one.
I wonder if it's possible to assign different names to each application.
With an application, I access using the address:
http://sf-spartan.eastus.cloudapp.azure.com
You can configure for access to look like this:?
http://application1.sf-spartan.eastus.cloudapp.azure.com
or
http://sf-spartan.eastus.cloudapp.azure.com/application1
Sure, have a look here. Use the ApplicationName argument to define it.
Every application instance you create must in fact have a unique name.
You can reach your application instance through its url by using a reverse proxy. (either the built-in one, or a custom one like Traefik)
Usually, the application and service name are part of the url, e.g.:
http://mycluster.eastus.cloudapp.azure.com:19081/MyApp/MyService
This does require a web based communication listener.
Event more info here.

kubernetes custom resource definition to keep track of the number of services/namespaces

I am trying to create a custom kubernetes controller which keeps the track of the number kubernetes resources, for example count the number services created in a cluster.
there are 2 parts to the above question:
1st I need to create a controller which listens to when a service is created, lets call this counter as svc_count. This is easy, as I can write a custom controller to listen on services.
I need to store the svc_count in the etcd, so that I can show the value
when some user queries for the svc_count. So I thought of using the CRD's. I can do that by following the example in https://github.com/yaronha/kube-crd. This has the Rest-API-client to POST,PUT,GET.
The 3rd part is relating the part 1 and part 2. Whenever a Service is created, then in the ADD eventhandler of the controller I need make changes to the CRD, so that the user can see the update.
Issue/Question: My question how to update a CRD from the custom controller's eventhandler??. Can I save the CRD rest-api-client in the custom controller and call the respective Update function.
Please, let me know if there is any other way of doing this.
Thanks

Calling client side human service from another client side human service

I have created two client side human services.
Now i want to call one client side human service from the second client side human service.
Is it possible to do so?
Generally moving between CSHS is handled by simply putting both CSHS in a wrapper service. Basically service 1 can either set a variable or use multiple end points to indicate where to go next. At least one of these options is to go to CSHS 2. We expose the wrapper service to the end user, and when they run it, they will wind up running CSHS 1, which is the first sub-service in the wrapper service. Then some interaction with the presented Coach has them go to CSHS 2.
You can fire second CSHS with the help of URL.you can expose service to user and put it in scrip to call it with window.open().

Rest path for application

I'm fairly new to Spring Boot, but I want to want to build my application in such a way, that can deploy mulitple applications on the same server and i want to distinguish the applications in the rest path.
For example, say i have the applications user-management and animal-management and i have a rest-controller in both of them responding to the path \names.
Both those applications run on localhost:8080 so when sending a GET to localhost:8080/users/names, I want the controller of the user-management to react and the same for animal with a GET to localhost:8080/animals/names.
I can put a #RequestMapping on the controller to acchieve the names part, but if i do the same on the application, it gets ignored.
Basically I want to tell my application "Every controller in this application should be mapped to the rest path specified on the controller, but prefixed with 'x'".
How can I do that.
I was looking for the contextPath, I just didn't know the name.
By putting the server.contextPath=/users attribute in the application.properies it worked like i wanted to.
Thank you #Vaionixx

WCF WorkFlow Service

I am working on WCF WorkFlow Service Application. i have two ReceiveAndSendReply Activity in sequence. i have set CanCreateInstance to true in both the activities Now i am not able to access the second ReceiveAndSendReply Activity. i know this because its needs to be executed sequentially right ? then how can i create WCF service methods in such way that i can call any of the method anytime.i think that can be achieved by creating State Machine Workflow but how to create in WCF WorkFlow Please suggest me some best ways i can do this.
You can put ReceiveAndSendReply in a pick branch. You can have several branches with several ReceiveAndSendReply activities. But if you have more service calls to your workflow then the recommended way is to use state machine.
Create a parallel activity and add one branch for every receiveandSend activity and set its CanCreateInstance to true