what is purpose of 'named' in Lagom - lagom

In the following code, I think that the services are given a name hello. Who uses this information? ServiceLocator?
named("hello")
.withCalls(
pathCall("/api/hello/:id", hello _),
pathCall("/api/hello/:id", useGreeting _),
)

This name hello is name of the service used by service locator.
Note, to register with the service locator, you would need to set withAutoAcl:
named("hello")
.withCalls(
pathCall("/api/hello/:id", hello _),
pathCall("/api/hello/:id", useGreeting _),
).withAutoAcl(true)
Without providing withAutoAcl(true), the service would start but will not be registered with the service locator. And hence you would need to make a call directly to it (on its port), rather than via the service gateway (which by default is 9000).
By marking it true, service gateway gets configured automatically, to forward the hello related service calls to your implementaion.

Related

Unable to add Java service reference to WCF client

I am uanble to add the below Java service reference in WCF Client
https://filetransfer.nordea.com/services/CorporateFileService
getting below error .
There was an error downloading 'https://filetransfer.nordea.com/services/CorporateFileService/$metadata'. The request failed with the error:
I opened the port 8000. still getting same issue.
Please let me know what is the issue.
Thanks
Jaya
Please note that a WCF service normally expose a file called a WSDL(Web Services Description Language) - this file explains the methods that you will use with the service
https://www.w3.org/TR/2001/NOTE-wsdl-20010315
Normally an endpoint needs to be created and be accessible for ypu to be able to view the service, what I would suggest is that if WCF doesnt seem to be doing that for you, try adding the service as a webservice Reference in your C#/Java project.
https://www.blackbaud.com/files/support/guides/infinitydevguide/Subsystems/infGC-developer-help/Content/AddingWebReference.htm

Which matcher should I use for a service, hosted on localhost {port} for a local Service Fabric cluster

I have a question regarding Service Fabric and Traefik.
I have managed to succesfully deploy the Traefik application to a local cluster (and actually out in my own Azure Infra too). This is alongside a service (MyService) in another application I am trying to have Traefik (RP) sit in front of.
I can see the Traefik dashboard, and I can see a backend (seemingly indicating that it has succesfully called the SF management API correctly for my application and service).
I can also see an accompanying frontend, with some routing rules (matchers). However, for the life of me, I can't get a simple request through the RP to my service.
I can hit my service directly. Service Fabric (SF) says it's in a good state also.
My local SF cluster isn't secured, so that simplifies things somewhat with .toml set up, etc.
My Service is hosted on localhost:9025 (endpoint is exposed in the service manifest and port set up (Kestrel in API)) the same too.
Traefik is set up on port 5000 (as opposed to 80 - see below).
To hit a simple version check, explicitly, I would use http://localhost:9025/myservice/myaction/v1/version
Doing http://localhost:5000/myservice/myaction/v1/version gets me either a 404 or 503 (depending on what I'm doing with matcher/modifier).
I have modified the Traefik endpoint from port 80 to 5000 too, just to switch it up and avoid any port conflicts. (I dont have an IIS sites up as it stands.) Netstat confirms that no other port is being used either.
The matcher in the Service Manifest looks like this:
<Extensions>
<Extension Name="Traefik">
<Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<Label Key="traefik.frontend.rule">PathPrefix:/myservice</Label>
<Label Key="traefik.enable">true</Label>
</Labels>
</Extension>
``` </Extensions>
One last thing, I guess, that would have really helped would be the ability to see the "resolved" requests. That is a request that comes into the RP, and then is matched or modified so that I can see what the RP actually reconciles a request out too. Perhaps this already exists, but tweaking of various logging didn't yield this info.
Ok,
So there is nothing wrong with the Service Manifest relating to Traefik, but rather its the exposure of the Endpoint in the Manifest which is not understood by Traefik.
This won't work:
<Endpoint Name="MyService" Protocol="http" Type="Input" Port="9025" />
However, this will:
<Endpoint Name="MyService" UriScheme="http" Port="9025" />
( The other attributes, I omitted, can still be added, but this would seem the minimum needed for Traefik to enumerate it as a viable backend)
A clear indication of wiring is indicated in the Traefik logs (this was previously absent)
Wiring frontend frontend-fabric:/MyApp/MyService to entryPoint http
AND, in the UI, for the backend, the server URI is displayed, again, this was not before.
Forgive me if this is documented somewhere, but I couldn't find anything OTHER than I did consider not seeing the server URI an issue based on a screenshot on the set up Website for Service Fabric and Traefik.
Another symptom is that the Backend, if not wired up correctly, will be displayed red, when correctly configured it will be green.
As I say, all probably very obvious but I lost many hours on this simple amendment I needed to make.

Accessing Service Fabric with reverse proxy and SSL from custom domain

By following many docs/tutorials I implemented SSL with Kernel and reverse proxy in my SF.
I made it work but the access point Url is as follow : https://mycluster.westeurope.cloudapp.azure.com:19081
before I implemented https, I had a CNAME mycustomdomain.com redirecting to mycluster.westeurope.cloudapp.azure.com which was working fine.
So now, I would like to know if there's a way to call http://mycustomdomain.com
and access the actual Uri. Is there a way with what I already have in place through probes/lbrules for example? Or do I have to implement an Application Gateway or use API management or something else?
Edit : LBRules+Probes
AppPortProbe : 44338 (backend ssl port in the SF)
FabricGatewayProbe : 19000
FabricHttpGatewayProbe : 19080
SFReverseProxyProbe : 19081
[Rule : Probe]
[AppPortLBRule (TCP/80 to TCP/19081) : 19081]
[LBHttpRule (TCP/19080) : 19080]
[LBRule (TCP/19000) : 19000]
[LBSFReverseProxyRule (TCP/19081 to TCP/44338) : 44338]
You question is too broad, there are too many questions that might bring many answers, I will try to answer with a few options:
In your scenario, to access the same url you should use https://mycustomdomain.com:19081 instead.
The problem here is, when you setup the cluster, the certificate used by the cluster is valid only for the domain 'mycluster.westeurope.cloudapp.azure.com' in your case your domain is not valid in the certificate used by SF and it will fail once you make any request to it.
You can skip certificate validation errors on your browser and continue. In your applications you could do the same, the problem is that is not a friendly way doing it.
To be able to use the domain without any conflicts, you have to register your own certificate created for the domain you own.
Because you are using reverse proxy, you also have to define the certificate in the cluster configuration, look for: reverseProxyCertificate in this link
For deploying applications using SSL will happen something similar, but in your application you can define the certificate you want to use on startup, in the cluster you have to define it in the cluster configuration.
You can find more information here:
Manage service fabric cluster security certificates
If the problem is the port, you have two options:
Create a 'Port forwarding' rule in the load balancer, to forward any
request in the port 80 to port 19081. You can find here how to do that with powershell.
Update the cluster/service configuration to listen in the port
80 instead of 19081. check it here
go to godaddy or whichever domain provider you use and add a transfert to your your azure domain : https://mycluster.westeurope.cloudapp.azure.com

WS2ESB 4.9.0 Sample 50: POX to SOAP conversion not working

I start ESB using this command:
wso2esb-samples.bat -sn 50
ESB starts and when I click on list under services it doesn't show any deployed sevrice.like that
http://localhost:8280/services/StockQuote
Please help. How can I see this service?
The relevant sample is not adding a proxy configuration, It overrides the main sequence configuration.
You can check the main sequence configuration in management console. Visit main->Sequences then you can see two sequences name as "fault" and "main".
You can edit the main sequence and see the added configurations there.
Note - ESB uses the main sequence to mediate unpointed messages to endpoints. So you can trigger it just using "http://localhost:8280/services/"
Go to Main -> Manage -> SourceView . Then you will be able to see the deployed service under main sequence. All the synapse configurations including proxy service, APIs, Sequences can be seen in Source View.

WCF bypassProxyOnLocal - What determines local?

I have added a WCF service to an existing ASP.Net web project on our test website (only accessible on company network). I can access the service by typing the URL in a browser, but if I add a service reference to a web project, I get a runtime error that 'the remote name could not be resolved'.
In my web.config, I have the bypassProxyOnLocal binding attribute set to 'true' (we use a proxy on the company network), but it seems as though our test domain is not recognized as a local domain (or recognized at all, really). Again, this is only when I add it as a service reference. Obviously the domain is valid, because I can add it as a service reference, and can event paste the URL into a browser, and it works. I just get a runtime error after I add it as a service reference. Anyone have any advice?
According to MSDN WSHttpBindingBase.BypassProxyOnLocal Property, "An Internet resource is local if it has a local address. A local address is one that is on same computer, the local LAN or intranet and is identified, syntactically, by the lack of a period (.) as in the URIs "http://webserver/" and "http://localhost/".
If your test domain is "http://test.mycompany.com/", then it won't be viewed as a local address. Perhaps using "http://test/" in this case would work?
Finally got this resolved. The request was somehow being blocked by the company network.