Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot 3.1.2 #27

Merged
merged 12 commits into from
Sep 22, 2023
Merged

springboot 3.1.2 #27

merged 12 commits into from
Sep 22, 2023

Conversation

AbdelHedhili
Copy link
Contributor

No description provided.

AbdelHedhili and others added 2 commits August 18, 2023 13:08
Signed-off-by: Abdelsalem <abdelsalem.hedhili@rte-france.com>
@@ -461,7 +461,6 @@ public void stopTest() throws Exception {
assertNotNull(output.receive(TIMEOUT, shortCircuitAnalysisRunDestination));
mockMvc.perform(put("/" + VERSION + "/results/{resultUuid}/stop" + "?receiver=me", RESULT_UUID_TO_STOP))
.andExpect(status().isOk());
assertNotNull(output.receive(TIMEOUT, shortCircuitAnalysisCancelDestination));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to find another workaround (see comment line 446) or fix this correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is the consumed message are no longer available on the queue so checking the output doesn't cut it anymore. I don't understand how this relates to the comment you mentioned. This problem happened with all the tests containing checks on consumed messages.

AbdelHedhili and others added 10 commits August 31, 2023 14:22
Signed-off-by: Abdelsalem <abdelsalem.hedhili@rte-france.com>
…:git-commit-id-maven-plugin

Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
…or spring cloud stream 4+ compatibility when the object is null

It works with 3.2.4 but with 4.0.3 i'm getting
java.lang.ClassCastException: class [B cannot be cast to class java.lang.String

For spring cloud stream 4 vs spring cloud stream 3, in both cases, our string is converted to a byte[] with content-type application/json, but for 3.2.4 the byte[] gets converted back to the original string, whereas with 4.0.3 it gets converted to the parsed json object.

-> "null"
-> [110, 117, 108, 108] (spring cloud to byte[])
-> null # instead of "null"

With 3.2.4 the byte[] gets converted to string here: https://github.com/spring-cloud/spring-cloud-stream/blob/6bc8330dcbdee52e44266cbf0f0043cf4fc3c0d4/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/ApplicationJsonMessageMarshallingConverter.java#L109
With 4.0.3 it uses spring cloud function org.springframework.cloud.function.context.config.SmartCompositeMessageConverter which uses jackson readValue on the string.

With 4.0.3 if I send a non null object, I get the previous behavior (because of an intermediate try/catch in spring cloud stream which falls back to restoring the string, I guess not very good for performance and design?):
"com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.lang.String from Object value (token JsonToken.START_OBJECT)"
https://github.com/spring-cloud/spring-cloud-function/blob/cc740db82e27efee4e23af4ad8e1de6f6a6fc9e9/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/config/JsonMessageConverter.java#L98
the getFeederResults and getLimitViolations were empty, but now they have [null, null, null] ??
Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@jonenst jonenst merged commit 001aa7d into main Sep 22, 2023
4 checks passed
@Tristan-WorkGH Tristan-WorkGH deleted the springboot3 branch January 17, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants