Skip to content

Conversation

tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented Jun 6, 2025

Closes #9012: IfPipe is supposed to pass on the input unmodified but when the input is a stream, there are various ways in which it can lose the input.

@tnleeuw tnleeuw self-assigned this Jun 6, 2025
@tnleeuw tnleeuw marked this pull request as ready for review June 6, 2025 12:32
@tnleeuw tnleeuw requested review from nielsm5 and evandongen June 6, 2025 12:33
return MediaType.APPLICATION_JSON;
try {
InputStream inputStream = message.asInputStream();
inputStream.mark(20_000);
Copy link
Member

Choose a reason for hiding this comment

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

Ik weet niet of de jsonParser meer wilt inlezen en dit nu goed gaat omdat onze test input niet groter is dan 20_000L

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dat risico is er. 20K leek me een redelijke buffer.
Ik kan dit hele stuk er ook uithalen en maar aannemen dat het JSON zal zijn als het begint met { of [, daar heb ik over getwijfeld.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PS: De parser is een streaming parser. Hij zal niet meteen de hele JSON inlezen, behalve misschien in bepaalde edge-cases.
Daarom verwacht ik niet direct een probleem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ik heb 2 tests toegevoegd voor grote JSON berichten. Lijkt te werken, in ieder geval met deze berichten.

Copy link

sonarqubecloud bot commented Jun 6, 2025

@nielsm5 nielsm5 merged commit 9907519 into master Jun 6, 2025
35 checks passed
@nielsm5 nielsm5 deleted the issue/9012_IfPipeWithJsonLosesInput branch June 6, 2025 21:25
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.

ifPipe loses the input
3 participants