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

Quarkus Multipart not working for multi layer applications #23986

Closed
git4rputuval opened this issue Feb 26, 2022 · 8 comments · Fixed by #24014
Closed

Quarkus Multipart not working for multi layer applications #23986

git4rputuval opened this issue Feb 26, 2022 · 8 comments · Fixed by #24014
Assignees
Labels
area/rest-client env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@git4rputuval
Copy link

Describe the bug

We have an export-import microservice design that exports and imports data, one microservice component per family of entities.
This microservice design imports & exports using rest reactive design. And it works perfectly without any issues.

Requirement
But now we have a different requirement. We have a module that provides the user a page to select the list of microservices that needs to be exported and/or imported. After selecting multiple microservices and clicking on "Export" button, a zip file will be generated that contains the exported file of all the microservices selected on the page.

Design
Since all the components already have the export import function, all I have to do is created a separate service that will do the following.

  • Take a request that comprises the selected component names.
  • Iterate through the component names, and build a Unijoin list to call the export import function of all the microservices in parallel.
    UniJoin.Builder<CommonAccountTypeXMLDto> builder = Uni.join().builder(); builder.joinAll().andFailFast();
  • Collect the files into a zip file, and return the zip file.

Issue
The service uses Rest Reactive Client to connect to the individual microservices. So I use the 'Rest Reactive Client with Multipart' approach. But it gives an error.
022-02-25 16:13:11,174 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-0) Request failed: javax.ws.rs.ProcessingException: Response could not be mapped to type class com.company.services.exim.client.DownloadFormData

Expected behavior

A Quarkus microservice using Rest Reactive Client fails with an exception when it connects with a Quarkus Rest Reactive Service. Though the requirement is for Multipart bodies, it fails for normal bodies too.

In summary, a Quarkus service calling another quarkus service using Rest Reactive Client fails.

Actual behavior

Quarkus Rest Reactive Client should be able to connect to a Quarkus Rest Service.

How to Reproduce?

Steps to reproduce the issue:

  1. Create a Restful Reactive service with two methods, one returning a normal class, while other returns Multipart.
  2. Create a separate service with a Restful Reactive Client having the same two methods as defined in Step 1.
  3. Call the service through postman.

Error occurs:
022-02-25 16:13:11,174 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-0) Request failed: javax.ws.rs.ProcessingException: **** could not be mapped to type class ***.***.***.*******

Output of uname -a or ver

Microsoft Windows [Version 10.0.19044.1526]

Output of java -version

Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.0.FINAL

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)

Additional information

Error.txt
raj-quarkus-multipart.zip

Sample
For the sake of simplicity, I am attaching a single project that contains a server project and a client project.

  • Server package returns a multipart object when export is clicked.
  • Client package contains the Rest Reactive Client to call the server project.

Also attached is the error text. You can run the project and reproduce the same error. Use postman to call the function.

Please help find the actual cause of the error. Thanks!

@git4rputuval git4rputuval added the kind/bug Something isn't working label Feb 26, 2022
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Feb 26, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 28, 2022

/cc @FroMage, @geoand, @stuartwdouglas

@geoand
Copy link
Contributor

geoand commented Feb 28, 2022

This is about the Multipart support in the Reactive REST Client, so cc'ing @michalszynkiewicz

@michalszynkiewicz
Copy link
Member

the only thing that didn't work for me in the reproducer with the current version was receiving small files, I fixed it with the linked pull request.
I'd be grateful if you could verify all works for you with the main branch when the linked PR is merged

@michalszynkiewicz
Copy link
Member

I just checked and the version you were using didn't support multipart responses at all, we support them since 2.7: #22855

@michalszynkiewicz michalszynkiewicz self-assigned this Feb 28, 2022
@git4rputuval
Copy link
Author

@michalszynkiewicz thanks. Will upgrade to 2.7.2.FINAL from 2.5.0.FINAL, test and will revert.

@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Mar 1, 2022
@michalszynkiewicz
Copy link
Member

@git4rputuval please note that until a new version that contains #24014 is released it will be failing on small files (smaller than 16KB)

@git4rputuval
Copy link
Author

@git4rputuval please note that until a new version that contains #24014 is released it will be failing on small files (smaller than 16KB)

Thanks @michalszynkiewicz … I was struggling to understand why the sample project kept failing. Once I added the code to push the file size to above 16KB, it worked.

So now I have to wait till #24014 is resolved. Any timeline you have in mind to get this fixed. We have a release in April 2022.

@michalszynkiewicz
Copy link
Member

it's already fixed but needs a new Quarkus release.
@gsmet do you know when we may have a new Quarkus 2.7 release (that could incorporate #24014)?

@gsmet gsmet modified the milestones: 2.8 - main, 2.7.3.Final Mar 1, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
5 participants