spring boot actuator works in local but not in production (aws) - spring-boot

Spring boot actuator works fine on my local and I can access it in browser
http://localhost:8000/actuator
I can access my system in production as follows
https://somedomain.com/#/overview
But I cannot access the actuator when the system is deployed in AWS, when accessed as follows
https://somedomain.com:8000/actuator
In AWS EC2 console, I notice that port 8000 is enabled as custom TCP for inbound rules

Related

Spring Cloud Gateway Proxy Host issue

I am running Spring Cloud Gateway with Spring Boot version 2.5.8 and Spring Cloud version 2020.0.5.
I am trying to configure Spring Cloud Gateway to validate JWT access tokens using Spring Security and thus the gateway needs to connect to the OAuth2 Authorization server external to my company's network. As per company standard, I am using a proxy host to connect to the external Authorization server and I have set the http.proxy* and https.proxy* environment variables ie
-Dhttp.proxyHost=my-proxy.com -Dhttp.proxyPort=3328 -Dhttps.proxyHost=my-proxy..com -Dhttps.proxyPort=3328 -Dhttp.proxySet=true -Dhttps.proxySet=true
and well as the properties in application.yml. ie
spring:
cloud:
httpclient:
proxy:
host: my-proxy.com
port: 3328
But I am getting timeout error when connecting to the external Authorization Server. The proxy host and port are correct and are working for other Spring Boot projects using Spring MVC. I saw this question/answer
spring-boot app as spring-cloud-gateway has to use a proxy: JVM arguments not used NOR spring.cloud.gateway.httpclient.proxy.****
But my entries in application.yml is not working. Would appreciate if someone can provide some advice on resolving the issue.
Thanks

Spring Boot Admin server on Cloud Foundry with SimpleDiscoveryClient

I am trying to setup a Spring Boot Admin server on a Cloud foundry. I am using the client Spring Cloud Discovery with SimpleDiscoveryClient configuration. We are not having any Thrid Party service discovery client like eureka. I can see the service getting registered to the spring boot admin server. But when i scale up any service, i see only one instance of that service and the actual number of instances are not reflected. I would like to know if that is possible without Eureka or any other service discovery, if yes how to achieve that without them.
Thanks

AWS EC2 - not able to trigger spring boot webservice from outside but running fine in local host

I am running a spring boot web app for restful sevices in ec2 windows. It is working fine local host. I am using port 8083. But not able to trigger s3rvices from outside.
I have opened port 8083 in security group as TCP.
Plz help..What could be issue.
Same EC2 has .Net web application running and it is working fine and able to access from outside.
Ensure that 8083 port is open for inbound and outbound properties in security groups of ec2 instance.
Refer this to do the same.
How to open a web server port on EC2 instance

Run spring boot website without adding HTTP or HTTPS

I am working with spring boot microservice application and gateway generated using jhipster. I have hosted my site on AWS EC2 instance.
Site Url: http://192.167.1.17:8082
I have redirected the port to 443 to run on https.
Let's say my site is :
http://192.167.1.17 OR http://mytestsite.com
Now the requirement is that if I type in the browser - 192.167.1.17 OR mytestsite.com
It should automatically redirect to :
http://192.167.1.17 OR http://mytestsite.com
Spring boot application has embedded tomcat. How can I do this HTTP or HTTPS redirect automatically with the hosted site on AWS EC2 instance?

Turbine stream double port binding issue

I'm using Spring Boot 1.5.4 and Spring Cloud Dalston SR4 to stand up a Turbine server on Cloud Foundry and aggregate my application Hystrix streams. In addition I want to add Spring Boot Actuator monitoring and management to the Turbine server. I realize there is ample documentation on how to do this in a local environment and I do have it working locally. However it is a different matter when deploying to Cloud Foundry where I cannot use port numbers in a Url binding.
The issue is that the Turbine stream is provided by an RxNetty server on one port and the Actuator endpoints are provided by via Tomcat on another port. In Cloud Foundry I can only bind my Url to RxNetty endpoint or the Tomcat endpoint, not both.
No combination of management.port and turbine.stream.port allows me to access the turbine stream and the actuator endpoints from one host binding. The following is an example of what I would expect to be able to do:-
https://myapp.mydomain.com/info (to report actuator info details)
https://myapp.mydomain.com/turbine.stream (to stream turbine metrics)
Note: There are no port numbers in these Urls.
Requests to your app on Cloud Foundry go through the Cloud Foundry Go Router, which uses the http host header to direct traffic to all the container instances running your app. The http based gorouter expecter only one port to be opened by the app to forward http traffic to. However, the gorouter also support tcp routing which should allow you to have multiple ports open. see the docsfor an explanation of tcp vs. http routes on cloud foundry.
If you are running on Pivotal Cloud Foundry you can use the Circuit Breaker Dashboard provided by Spring Cloud Serviecs for PCF then you won't need to setup the turbine stream. The Spring Cloud Services Dashboard uses RabbitMQ instead of SSE events see SCS docs for details
Just getting back to this now. As noted by spencergibb, moving to springboot 2.0 and cloud Finchley works.

Resources