Spring boot admin behind firewall - spring-boot-admin

I have a spring-boot client app deployed in a customer network and I want to use SBA as a GUI for its actuator endpoints. I cannot use register-client-applications to register the app, mainly because the client app has no connectivity to SBA (its behind a firewall).
Is there a way how to add a client to SBA manually?

You can add use a static configuration for spring cloud's discovery client. So there is no need that the client reach the sba server. See http://codecentric.github.io/spring-boot-admin/current/#spring-cloud-discovery-static-config

Related

Connecting services without Dapr

New to Container Apps.
I'm trying to understand basic connectivity between services in Container Apps.
Lets say I have a web front in .Net Core and an Web API backend (.Net Core).
Without containerization, I could put the base address of my web api in my app settings of the front end to connect to the api, lets say localhost:5000 etc. Using an httpClient to do the call.
If I containerize the front end and api and deploy it to ACA, what would that look like? I think its would be like:
Ingress external for front end
Ingress internal for api
Port 80 for both front end and web api????
Or do I need to setup a base address of some sort to call the web api? Or an environment variable?
I put both ports to 80 but they cannot seem to connect.
Thanks!
In your "Without containerization" example, if your web ui is running on localhost:8080 for example, and your API is running on localhost:5000 then you'll need to enable CORS on the api. In That example, both your web ui and your api are "external". Anything you need to call from a browser is 'external'.
Internal only are for server to server communication, or microservices communicating with each other.
In your example, you'd deploy both as external apps, this will give you 2 domains https://webui.env.region.azurecontainerapps.io and https://api.env.region.azurecontainerapps.io then you will configure a CORS policy on the api app.
see this for more details

Get Eureka instance metadata in browser

I have a Spring Boot (2.4) app (a generic service) and a Eureka discovery server running. The server doesn't register itself as an instance. I am able to navigate to the Eureka dashboard at the default location of localhost:8761 to get an overview of all the registered instances. I successfully see the service is registered in Eureka. However, this dashboard doesn't give any details about the instance except the name and the port number. I want to be able to see the instance meta data. Is this possible using the dashboard? O maybe there is some exposed URL by the Eureka server that I can call in a browser or postman? Or is there an URL available in the Eureka client (the service) that gives details about its Eureka metadata?
I read thet feign clients access something to be able to query the registry. Can I mimic this as human in a browser?
Go to localhost:8761/eureka/apps

Spring Cloud Zuul - Add http proxy details (proxy server, proxy port, credentials etc) to the incoming request before routing

We are planning to build a reverse proxy server for our enterprise to make some external API calls.
Currently, our microservice applications are hosted on the PCF environment. For any external (on the internet) calls, we make use of the PCF proxy server to communicate.
Now my use-case is to build a reverse proxy server(Spring Zuul) to route to external APIs through the PCF proxy. However, the microservice applications wouldn't pass any proxy information on the request to the zuul server. So, this needs to be added by Spring Zuul reverse proxy server.
Problem:
How to add HTTP proxy details to the coming request from zuul server?
Any documentation also would be really helpful.

Spring cloud - Server and client

I'm config an application using spring cloud eureka. I start my discovery app in the 8761 port and reaching the console in "http://localhost:8761".
So, I start my client application and it's appear in the "Application" page of eureka console.
First question:
My client is using "server.port=0" in properties config so the tomcat port is starting in random. How can I reaching my services in client? Example: I have a get request in "/api/stuff", is that possible to access this not using the random port? Suppose I don't know the port!
Second Question:
I can start any clients I want, they will start, assuming a random port and register in the cloud server discovery, I can see the log:
"Registering application FLY-CLIENT with eureka with status UP"
But they don't appear in "Application" page of eureka console, why they don't appear?
Thanks!
If you are using Spring RestTemplate to request the services registered in Eureka you need to make it #LoadBalanced, something like this should do the try:
#LoadBalanced
#Bean
RestTemplate restTemplate() {
return new RestTemplate();
}
// usage
restTemplate.getForObject("http://your-service-name/api/stuff", StuffResponse.class);
As for the 2nd question, I'm a little confused, as you mentioned earlier in the question that your application appears on Eureka's dashboard. Is this behavior only happening for the "fly-client"?

Integrating Hazelcast with a web application running on tomcat with MongoDB as backend

I want to integrate Hazelcast with a web application running on a tomcat server. The backend is MongoDB. So far I have managed to integrate MongoDB with Hazelcast how do I integrate it with tomcat so that changes made to the DB through the UI can be seen in the IMaps used when i do a get call.
Not every get call will load from DB, only those keys that are not present in Hazelcast cluster will be loaded from the DB.
As for integrating with a web server, not sure what you meant there because the code that loads from DB runs on Hazelcast server. An application, whether it is a simple public static void main(...) or a web app running in a container or a web server, is a client to Hazelcast server - means, you will be required to use client proxies to connect to servers.