Spring Cloud Config Server: configure git pull interval - spring

I am using Spring Cloud Config Server connected to Eureka Server with BitBucket git repository.
I found out under debugger that org.eclipse.jgit.api.PullCommand#call is being invoked via scheduler each time Config Server is updating it's status with Eureka.
Moreover, it's invoked each time connected services are querying for the updated config, and even each time /health endpoint is requested on Spring Cloud Config Server or on the connected client.
I believe it's a big overhead in terms of HTTP response time, but also in terms of the outgoing traffic.
Is there a way to update locally cloned repository less often?
P.S. I know that there is a File System Backend, or I can point Config Server into manually cloned local (i.e., file:///) repository. But I wonder if there is such a functionality out of the box.

You can turn off the health indicator on config server, via spring.cloud.config.server.health.enabled=false and health.config.enabled=false on the config client. Requests to config server always clone, so you need to turn down or disable health checks.

Related

Spring App on GCP - Cloud Run - HTTPS only - This combination of host and port requires TLS

My Spring app uses lets encrypt and is https only. I did not include http to https thing, as it worked for me in postman with https:// format
When I deployed to Cloud Run, and mentioned the custom port (the port specified in spring)
and tested using URL from dashboard
https://..blah..run.app
I am getting error/message
Bad Request
This combination of host and port requires TLS.
What configuration is required on Cloud Run to resolve this?
The url as I see on service details page has htpps://...
EDIT:
If Cloudrun does not need me to take case of SSL, I can remove the application properties entries
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:key/keystore.p12
server.ssl.key-store-password=${lets.secret}
server.ssl.key-alias=someCertAlias
server.ssl.enabled=true
So Can I get an answer on whether to remove SSL from spring?
If cloudrun always uses http, all my calls use redirectConnector, which seems pointless
The Cloud Run Service listens on HTTP and HTTPS. Your application running in the container must listen on a port configured with HTTP only.
FYI: For a public facing web server, you should almost always enable HTTP. Otherwise, when a user enters www.example.com in the browser, the user will receive a connect error. This not always the case, for example .dev gTLDs, but is good practice. When a user connects to Cloud Run with the HTTP protocol, Cloud Run will redirect the user to HTTPS and connect to your application using the HTTP protocol.

changing jhipster-registry port

I've looked over most of the documentation provided, couldn't find an absolute answer about changing jhipster-registry port, it's default is 8761, but when I try to chnage it's port through YAML config file it gets indeed working in that port but both the gateway and microservice cannot be found by the registry. am i doing anything wrong ? is jhipster-registry bound to remain intact when it comes to port manipulation ?
You must change port in spring.cloud.config.uri in all application's bootstrap*.yml so they can retrieve their config from the registry and also change it in eureka.client.defaultZone in application.yml in jhipster-registry's central-config folder if you use file system backend or in git repo if you use git backend.
This is because the registry is both a Spring Cloud Config server and an Eureka server. In JHipster's setup, the applications first connect to the config server, retrieve their config which indicate the URL of the Eureka server. As this is a common config for all apps, it's set in application*.yml in config server.
Please read also the jhipster-registry doc: https://www.jhipster.tech/jhipster-registry/

Corda performance tool - setting of multiple jmeter servers

I have setup a JMeter client and server , following the instructions in the documentation .
I could successfully invoke transactions locally as well remotely .
Now I want to increase the number of JMeter servers
added the server Ip and port in jmeter.properties
made an entry in server rmi config file
started the client
When I start the server , it starts but does not refer to the rmi server config , in logs it says
jmeter.Launcher$Companion.prepareJMeterArguments$jmeter - No rmi server mapping found, using default server.rmi.localport - assuming no ssh tunnelling in effect
The command used to run server:
java -jar jmeter-corda-4.0-capsule.jar -XjmeterProperties jmeter.properties -XrverRmiMappings sample-server-rmi.config -- -s
Any config has to be modified? other then the remote_hosts and server rmi config file?
I'd say to take a look at the jmeter page on the docs to double check whether any of the config options to see if any of them have changed. (https://docs.corda.net/docs/corda-enterprise/4.4/performance-testing/running-jmeter-corda.html#running-jmeter-corda)
So this is a feature that only works on corda enterprise and NOT on corda open source, if you're paying R3 for it you should have a contact for enterprise support that should be able to help you with the small stuff like this.
Worth mentioning as well that there's new releases of corda (now 4.5) so you might want to take a look at that as well to see if your issue has been fixed already.

How to disable/configure the Spring Cloud Gateway rewriting of Location headers

We have a setup with Spring Cloud Gateway running with consul service discovery and proxying requests to services in a cluster.
When one of these services responds with a Location: / header this gets rewritten on the way out thru the gateway.
The problem is that the gateway seems to add the service local hostname and port as found in Consul. This url is of course not available (or desirable) for the client.
I have verified thet the upstream server sends:
Location: /
(Generated by the "redirect: /" Spring MCV shorthand)
But when it reached the end client is rewritten to:
Location: https://10.0.0.10:34567/
(https://10.0.0.10:34567/ being the upstream location of the service in consul)
If is of course incorrect.
My problem is that I can't find any documentation on how to configure this and no indication of what classes are used (to debug) so I just don't know where to start looking for the fix.
The desired behaviour is of course to just leave the redirect unchanged.
In this particular case we use a host based routing setup:
.route("app", r -> r.host("app.**").uri("lb://app"))
Any help or hint appreciated.

spring-cloud-config fallback server

Can spring-cloud-config be configured to have more than one config server? So that if one would fail, it would fall back to another one?
If that is possible, and the 2 severs are using filesystem instead of git, is there a sync between those, or do both have to be updated manually?
I did not find this directly in config server. But you can use discovery service as eureka and have as many config server instances as you want: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#eureka-first-bootstrap
From docs: "To scale the Config Server up and make it highly available, you would need to have all instances of the server pointing to the same repository, so only a shared file system would work. " you can use rsync for that.

Resources