I need to upload a file from Quarkus application to jesrey 2 rest service which is expecting two params like
@FormDataParam("file") InputStream uploadFileInputStream,
@FormDataParam("file") FormDataContentDisposition fileMetaData
Used below code in Quarkus to send file
public class MultipartBody {
@FormParam("file")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
public InputStream file;
@FormParam("fileName")
@PartType(MediaType.TEXT_PLAIN)
public String fileName;
}
@RegisterRestClient
public interface MultipartService {
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
String sendMultipartData(@MultipartForm MultipartBody data);
}
I'm getting 500 error while calling the service. In service side logs, it says fileMetaData
is null