Is it possible to expose Twitter's Finatra admin pages (port 9990) on the main service port? - scala

We are working on a service using Twitter's Finatra. The main web services are exposed in port 8080 (using override def defaultFinatraHttpPort = ":8080"). Finatra exposes Finagle's Http Admin interface automatically on port 9000. Is it possible to instruct it to expose the /admin/* endpoints on the main application port (i.e. 8080)?
I've tried overwriting the 'adminPort' var, however Finatra will try to create another Http listener on that port, which will fail because there is one already created. What I'm trying to do is to link the admin controllers to the main Http listener, so that everything is accessible from one single http port.

Related

TCP/IP Monitoring in Eclipse-Stub based client call

I generated Web service client using the given WSDL in Eclipse. I have written a main method to invoke the Proxy class for getting the response.
https://val-p1-all-vim:8080/Selfcare/address?wsdl
I want to see the request that am making for debugging. I don't know what to configure as a Local monitoring port.
Local monitoring port: ?
Host name: val-p1-all-vim
Port: ?
Type: ?
Please help me with this.
You are free to choose a port that is not in use on your system like 8080. In your program change server to localhost:, e.g. localhost:8080.
A problem is that you can't connect to https. Your web service should also allow http.

GWT with http loadbalancer gives invalid SID value

I have 2 openfire servers and an elastic loadbalancer over them and built a gwt application that using http bind at port 7070
when connecting directly to one server it works good but when it connects to the loadbalancer on port 7070 it’s not working and output an error with 404 invalid SID value
Note:
When the load balancer is working at tcp mode it works fine but when its http mode it doesn’t work and i need to make a sticky session for it
That's because once BOSH session is established on one machine then it's tied to this machine. Without enabling sticky session on the ELB subsequent requests from the client can be routed to the second server, on which there is no BOSH session that maches the request, which in turn results in invalid SID (because SID doesn't exist on the other machine).
Alternative solution would be (if the machines would also expose public IP) to return "host" information in the BOSH response therefore client could use that information and then make subsequent requests to correct machine. But if that's not possible, they ou have to use "sticky session".

How to connect two applications runninig within Kubernetes

I have an application running on my own server with kubernetes. This application is supposed to work as a gateway and has a LoadBalancer service, which is exposing it to "the world". Now I'd like to connect this application with other applications running within the very same kubernetes cluster, so they can exchange HTTP requests with each other.
So let's say that my Gateway app is running on the port 9000, the app which I'd like to call runs on 9001. When I make curl my_cluster_ip:9001 it gives me a response. Nevertheless I never know, what the Cluster IP will be, so I can't implement this to my gateway app.
Use case is typing to the web browser url_of_my_server:9000 -> this will call the gateway -> it sends HTTP Request to the other app running in the cluster on the port 9001 -> response back to the gateway -> response back to the user.
Where the magic has to happen and how to easily make these two apps to talk with each other, while only one will be exposed to "the world" and the other one will be accessible only from within the cluster?
You can expose your app on port 9001 as a service (lets say myservice).
When you do that myservice.<namespace>.svc.cluster.local will resolve to IP addres of your app. More Info on DNS here : https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
And then you can access your app within Kubernetes cluster as:
http://myservice.<namespace>.svc.cluster.local:9001
You have a couple of options for internal service discovery:
You can use the cluster-internal DNS service to find the other application, as detailed in the answer by bits.
if both the proxy and the app runs in the same namespace, there are environment variables that expose the IP and ports. This may mean you have to restart the proxy if you remove/readd the other application, as the ports may change.
you can run both apps as two different containers in the same pod; this will ensure they get scheduled on the same host, which allows you to communicate on the same host.
Also note that support for your HTTP proxy setup already exist in Kubernetes; take a look at Ingress and Ingress Controllers.

"HTTP Error 503. The service is unavailable" on port sharing with WebListener on Service Fabric

I want to share http/80 port for two different web application(webpi/website) inside service fabric cluster, the application must have 2 different host name:
mywebapi.com and mywebsite.com
if i run the apps out of fabric(console app) all works fine:
The first console app
var _webHost = new Microsoft.AspNetCore.Hosting.WebHostBuilder()
.UseWebListener().UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>().UseUrls("http://myWebApi.com/").Build();
The second console app:
var _webHost = new Microsoft.AspNetCore.Hosting.WebHostBuilder()
.UseWebListener().UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseUrls(
"http://myWebSite.com/"
)
.Build();
but if i run apps inside a local fabric i get:
HTTP Error 503. The service is unavailable.
I've setup correct ACL with netsh and SetupEntryPoint(no Access Denied on open).
On microsoft http.sys guide explicit host is allowed.
Make sure you remove any HTTP Endpoint configurations for port 80 in your ServiceManifest.xml, otherwise Service Fabric will override your domain-specific ACLs. See here for info: host multiple public sites on service fabric
Why not just publish both to a non 80 port and use the default load balancer to remap it ?

How can I get my services to register with a specific port in Eureka?

My Setup
I have some services that register with Eureka. This registration info is used by Zuul to route requests to my services. Most of these services run on a port like 9999 or 8080. Each service is on it's own EC2 instance, and I have Nginx routing requests from port 80 to the server's port, so that I can keep my Security Group rules simple.
My Problem
When my service registers with Eureka, it gets registered with ${server.port}, which ends up being 8080 or 9999, etc. When Zuul attempts to route to {ec2host}:8080, it gets blocked by my Security Group rules. Based on the documentation, it looks like I should be able to specify a host and port with eureka.instance.hostname and eureka.instance.nonSecurePort. Whether I use those properties or not, my service registers with it's specific port.
Is there a way to get the Eureka client to register my service with port 80, instead of the server's port?