Skip to content

Commit

Permalink
fix: increased max upload file size in Wildfly / RESTEasy (#621)
Browse files Browse the repository at this point in the history
To allow for max 80MB file uploads.

Solves PZ-1566
  • Loading branch information
edgarvonk authored Feb 22, 2024
1 parent 1955844 commit 40a1d6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
23 changes: 10 additions & 13 deletions src/main/java/net/atos/zac/configuratie/ConfiguratieService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

package net.atos.zac.configuratie;

import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.persistence.EntityManager;
Expand All @@ -21,12 +15,16 @@
import jakarta.persistence.criteria.Root;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.core.UriBuilder;

import org.eclipse.microprofile.config.inject.ConfigProperty;

import net.atos.client.zgw.ztc.ZTCClientService;
import net.atos.client.zgw.ztc.model.CatalogusListParameters;
import net.atos.zac.configuratie.model.Taal;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

@ApplicationScoped
@Transactional
Expand Down Expand Up @@ -61,12 +59,11 @@ public class ConfiguratieService {

public static final String ENV_VAR_ZGW_API_CLIENT_MP_REST_URL = "ZGW_API_CLIENT_MP_REST_URL";

// This value should also be set in the widlfly configuration.
// The value used in wildfly should be slightly higher to account for overhead. (e.g. 80MB -> 100MB)
// Note that WildFly / RESTEasy also defines a max file upload size.
// The value used in our WildFly configuration should be set higher to account for overhead. (e.g. 80MB -> 120MB).
public static final Integer MAX_FILE_SIZE_MB = 80;
private static final String NONE = "<NONE>";


private static final String NONE = "<NONE>";

@PersistenceContext(unitName = "ZaakafhandelcomponentPU")
private EntityManager entityManager;
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/wildfly/configure-wildfly.cli
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ data-source add \
#/subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=DEBUG)
#/subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=DEBUG)

# This sets the max post size accepted by the server/RESTEasy.
# NOTE: This is higher than our limit of 80MB because there seems to be some overhead.
/subsystem=microprofile-config-smallrye/config-source=props:add(properties={"dev.resteasy.entity.file.threshold" = "100MB"})
# This sets the max post size accepted by the RESTEasy framework in WildFly
# NOTE: This needs to set higher than our max file size setting in ZAC because of the way RESTEasy handles file uploads.
/subsystem=microprofile-config-smallrye/config-source=props:add(properties={"dev.resteasy.entity.file.threshold" = "120MB"})

0 comments on commit 40a1d6a

Please sign in to comment.