Rest API Issue after Upgrading JDK and Spring - java

Im having an api slowness issue after upgrading my application from Java 7 to Java 8 and SPring 3 to Spring 4
I was tasked to upgrade our application simple API that have JDK 7 and Spring 3 , to JDK 8 and Spring 4 , performance before was 300 ms and now its 1100 ms
I tried using Jmeter for testing and running it on local and remote machine its still the same result
Any suggestions how can I improve or determine the culprit of my issue?
New Performance with JDK8 and Spring 4
OLd Performance with JDK7 and Spring 3
New Performance with JDK8 and Spring 4 Summary
OLd Performance with JDK8 and Spring 4 Summary

Related

Upgrade to Elasticsearch 8 from 7.16

We deploy standalone ES pods and I saw that the system requirements say that Java 17 or higher is to be used. The java applications (separate pods of course) depending on ES are still on java 8 and we have no intention of upgrading the java version anytime soon. I wanted to confirm with the community at large if they faced issues any issues calling ES from applications on java 8? We are using the standard ES java libraries
org.elasticsearch.client:elasticsearch-rest-client
org.elasticsearch.plugin:parent-join-client
org.elasticsearch:elasticsearch-core
org.elasticsearch:elasticsearch
org.elasticsearch.client:elasticsearch-rest-high-level-client
I know restHighLevelClient is deprecated but we depend on spring-data-elasticsearch to provide some of the integration support.
I don't have enough reputation to add comment. I have similar problem on the upgrade. Here is from readme https://github.com/spring-projects/spring-data-elasticsearch
In Elasticsearch 8, the RestHighLevelCLient has been removed. This means that a switch to this client version can only be done with the next major upgrade which will be Spring Data Elasticsearch 5, based on Spring Data 3, used by Spring Boot 3, based on Spring 6 and Java 17.
Below has dependencies and upgrade info.
https://www.elastic.co/guide/en/elasticsearch/reference/current/dependencies-versions.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html

Does Spring support OpenJDK 12

We are planning to migrate our application from Oracle JDK 8 to OpenJDK 12. Currently we are using Spring Boot version 1.4.5.RELEASE.
I have read many articles saying that from Spring Boot 2.2.X, we will have support for OpenJDK 12. Please provide your inputs.
According to the Spring Framework Wiki (as per the August 2020 update)
JDK Version Range
Spring Framework 5.3.x: JDK 8-17 (expected)
Spring Framework 5.2.x: JDK 8-15 (expected)
Spring Framework 5.1.x: JDK 8-12
Spring Framework 5.0.x: JDK 8-10
Spring Framework 4.3.x: JDK 6-8
We fully test and support Spring on Long-Term Support (LTS) releases of the JDK, i.e. currently JDK 8 and 11 (both with a lifetime until 2023) and expecting JDK 17 (to be released in late 2021). Additionally, there is support for intermediate releases such as JDK 9/10/12/13/14 and the upcoming JDK 15/16 on a best-effort basis, meaning that we accept bug reports and will try to address them as far as technically possible but won't provide any service level guarantees.
Please upgrade to Spring Framework 5.1+ (and the corresponding Spring Boot 2.1+) for JDK 11+ support, as the common Long-Term Support migration path from JDK 8. No earlier Spring versions are officially supported on JDK 11, in particular not with JDK 11 bytecode level. Note that third-party components might not fully support JDK 11 yet, so you are likely to be limited in your full-stack options.
The above Wiki page is updated regularly, and you are advised to check it yourself.
If you switched to Spring 5.1.x, you will be OK on Java 12.
As for Spring Boot, 2.1 is good for Java 11. Spring Boot 2.2 supports up to Java 13.
(You can look up the versions of Java supported for a given Spring Boot release by looking at the "Getting Started" page of its reference documentation.)

Compatibility jhipster microservices 4.6.0 & 5.2.1 & 6.x.x

we have microservices with 4.9.0 and with 5.2.1 and now we want create new microservices with 6.x.x is recommended have microservices with differents versions in the same registry?
We dont upgrade because we tried and is impossible we have a lot of code yet in old microservices.
And in gateway is imposible migrate angular 4 to angular 6 with our quantity of code.
I have successfully used a recent registry with gateways and services generated by JHipster 3.9.0. Eureka REST API is quite stable. I have upgraded manually some services from Spring Boot 1.3 to 1.5 in order to be able to use hazelcast-eureka-one that required a more recent version of Spring Cloud.
I don't understand why you say it's impossible, unless you want to use jhipster upgrade or you don't have a good test coverage.
I don't plan to use jhipster upgrade at all, it would be a waste of time because of too many major versions until current. I prefer to copy my .yo-rc.json and JDL to a blank folder and generate with latest version of JHipster and then pick up what I need, step by step.
Upgrading from Angular 4 to 6 is easy, it should not be a problem for your team.
Overall, I don't see it as a JHipster problem, it's the same as if we had started from scratch without a generator.

Use Java 10 with Spring MVC 5

Currently I am using Java 8 and Spring MVC 4. I want to upgrade java into 10 and spring into 5. So Is Spring MVC 5 is compatible with Java 10 ?
They added support for JDK9 features, most notably the Flow API (cf their documentation). And, as far as I know, it seems compatible with JDK10.
The language changes in java 10 are pretty minor and retro-compatibles. I'm using spring 5 with java 10 and still haven't noticed any regression.
Looking to the service Spring Initializr in full version it is possible to choose between java 8 and java 10, so I think that it is fully compatible.

Do I need Spring 5 for Java 9?

Spring 5 is promoted as "with support for JDK 9", meanwhile the documentation for Spring 4.3.13 states that it supports Java 8 (as well as 6 and 7).
Does this mean that I need to upgrade to Spring 5 before I can
run my application in JRE 9?
compile my application using JDK 9?
Spring
On the official Spring blog, they announced that Spring 4.2 would support Java 7 and 8 (it didn't change in 4.3), and they also said that Spring 5 would support Java 9.
It is implied that Spring 4 won't support Java 9.
But it depends of what you're doing: on this blog, the writer is testing Java9 on Spring 4 and he said:
However, before we begin, a quick disclaimer: I will be demonstrating migrating Spring 4.x/Spring Boot 1.x applications to Java 9. As far as I have heard, there will be little to no formal support for either in Java 9. So far, I haven’t run into many issues once I have gotten the applications running, however, as these are primarily proofs of concept, they have not been thoroughly vetted.
Because "doesn't support" only means you're not sure of the comportment, If you're using anything that changed in Java9, you should consider migrating (unless you can test it first).
Spring Boot
Spring boot 1.x does not support Java9. If you want to use it, you have to migrate to Spring Boot 2.x.
Actual
For all that sake, if you are planning to compile your code built with Spring 4.x with Java9 it should just work fine based on the backword compatbility of Java9 which has though been in question for certain implementations and the precise answer there would be dependent on your usage of spring as and when you move ahead and try out things.
Theories
The 5.0.0-RC1 release of Spring framework was announced with the support for Java 8+. The announcement included the theme declared for Java9 pertaining development as well:-
Ready for JDK 9: fully aligned with JDK 9 at runtime, on the classpath
as well as the module path (on the latter: as filename-based
“automatic modules” for the time being).
This candidate is currently available since November 1, 2017 which can be used from
repositories {
maven { url 'http://repo.spring.io/libs-milestone' }
}
compile "org.springframework.integration:spring-integration-core:5.0.0.RC1"
The certain good news to look for on that note would be :
We expect GA in a couple weeks - just in time for Spring Boot 2.0 GA!
Pertaining to Spring Boot with Java 9, the requirements are clear such that 2.x vs 1.x are categorized separately :
Spring Boot 2 is the first version to support Java 9 (Java 8 is also
supported). If you are using 1.5 and wish to use Java 9 you should
upgrade to 2.0 as we have no plans to support Java 9 on Spring Boot
1.5.x.
To keep an eye on the updates over the same, you can follow the Java 9 theme tracker as well as the 2.0 in Progress.
So the ideal world would be, migrating to making use of Spring 5.x/Spring Boot 2.x and Java 9 to get support over the latest features and any incompatibilities found further.

Categories

Resources