I just added spring-boot-starter-mail to spring-boot application to send mail.
The send mail is working, but when I set this flag to true spring.mail.properties.mail.debug=true logs show spring-boot application connect to mail server every 30 seconds.
How to make spring-boot application only connect to the mail server only when sending mail?
every 30 seconds the logs show this:
250-8BITMIME
250-STARTTLS
250-AUTH PLAIN LOGIN
250 Ok
QUIT
221 Bye
It turns out to be spring actuator
application is deployed on cloud with load balancer health checks calling /actuator/health every 30 seconds
I disabled mail health check with application.yml
management:
health:
mail:
enabled: false
Related
I have 2 war in my server. First starts very rapidly but the second one is longer to start.
My server is able to respond to REST calls when fast one is started but it seems that HTTP endpoint can only be accessed when both applications are started.
Is there a way to control this so that I can respond rapidely to REST calls with first application and let the second application startup in the background.
Yes, check this post - Configure IBM Websphere Liberty Profile Server Start & Stop timeout.
You can set <applicationManager startTimeout="1m"/> setting to tell server not to wait for applications that start longer than timeout. Be aware that any request that comes into an application that is not ready to serve requests will return a HTTP 404 response.
Setup: 2 eureka servers replicate. and 1 eureka client set the default zone in application.yml as localhost:8761, localhost:8762.
Question:
1.Will eureka client send heartbeat to both 8761 and 8762?
Thanks,
Young
No, it will not send the heart beat to both 8761 and 8762. How it works is- We provide the list of Eureka servers. All the clients will pick first server from the list (in your case 8761) and start sending the heartbeat. All the clients will switch to other server only in case first Eureka server dies.
Second server will always get a copy of registry from first server.
I have an eureka-server, eureka-client-1, eureka-client-2 and zuul-proxy deployed.
The eureka-client-* are changing from {status:"UP"} to {status:"DOWN"}.
How can I lower the delay so that zuul-proxy always points to one of the eureka-client-* that is {status:"UP"}?
There are several options to reduce the delay.
The values in below are just for example.
Eureka Server Response Cache
eureka server property
eureka.server.response-cache-update-interval-ms: 5000 (default 30000)
Eureka server has response cache for the performance, so it doesn't return actual values that it knows during above milliseconds. You can reduce this delay with above property.
Zuul Ribbon Cache
zuul property
ribbon.ServerListRefreshInterval: 5000 (default 30000)
As you know, zuul is using Ribbon for load-balancing and Ribbon has cache for server list. The default value is 30 seconds. You can adjust this value with above property to reduce ribbon cache time.
Eureka Client Cache
eureka client property (In your case, it's zuul property)
eureka.client.registryFetchIntervalSeconds : 30
Zuul is another eureka client and it is using eureka client to retrieve available server list for a specific service. The default interval for this is 30 seconds and you can adjust this value with the above property.
Lease Expiration Duration
eureka instance properties (In your case, for your eureka-client-1, eureka-client-2)
eureka.instance.lease-expiration-duration-in-seconds: 60 (default 90)
If Eureka server didn't receive heartbeat during above seconds, eureka server removes that instance from available server list. Each your client sends a heartbeat in every 30 seconds (that value is also configurable, but don't change this property because eureka server has some codes based on the assumption of this 30 seconds). So 90 seconds means that eureka instance will be removed from the list if it fails to send (or server fails to receive) heartbeats at three consecutive times. You can reduce this duration, but you may have some risks of that. This property must exist on your eureka client side.
There is a great article about this information here : http://blog.abhijitsarkar.org/technical/netflix-eureka/
I have my API gateway and all my microservices up and running in cloud foundry, and here's my configuration for the API gateway:
zuul.add-proxy-headers=true
zuul.routes.myservice.path=/ptp/myService/**
zuul.routes.myservice.url=${CLIENT_BASE_URL:http://localhost:8877/}/myservice
zuul.routes.myservice.sensitiveHeaders=
zuul.host.connect-timeout-millis=60000
zuul.host.socket-timeout-millis=60000
# Increase the Hystrix timeout to 60s (globally) hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000
ribbon.ConnectTimeout=60000
ribbon.ReadTimeout=60000
The problem is that when I try to reach out to my microservice the first time after being idle for some time, I see a connection reset error logged into the API gateway. I don't see anything logged in my client service.
But the same call is successful if I refresh my browser, or if I'm calling the service again.
I'm having trouble with a long running webservice timing out in an Oracle 10g environment.
The client calls the webservice and after approximately 10 minutes, it receives the following response:
HTTP/1.1 503 Service Unavailable Server:
OracleAS-Web-Cache-10g/10.1.2.3.0 Content-Type: text/html Connection:
Keep-Alive Keep-Alive: timeout=600, max=999 Content-Length: 402
No
Response from Application Web Server No Response from Application
Web Server There was no response from the application web
server for the page you requested. Please notify the site's
webmaster and try your request again later.
The webservice executes a procedure in the database which takes a long time to finish (more than 20 min, on average) and the client receives the above response after aproximately 10 minutes.
My guess is that the webserver thinks the webservice has crashed, so it terminates it and sends the above response to the client.
My question is: how do I deactivate the timeout setting? I need to let the webservice run for as long as it needs (or, at least, for severeal hours).
I don't have access to the webserver's configuration or administration console but I can ask the guys responsible for managing it to change any setting (this is a test environment).
Thanks in advance for any ideas.