Add configurable filesystem binary storage (fix #860) (#864)

* Add configurable filesystem binary storage (fix #860)

* Refine binary storage configuration handling

* Refine binary storage bean wiring

* Refine binary storage conditional beans

* Add integration coverage for binary storage configs

* Exercise binary storage via REST integration tests

* Update src/main/resources/application.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-35-43.eu-west-2.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-10-131.eu-west-2.compute.internal>
Co-authored-by: Jens Kristian Villadsen <jenskristianvilladsen@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Shamus Husheer
2025-10-09 08:39:01 -04:00
committed by GitHub
parent a55c8f20a9
commit cf003331e4
7 changed files with 516 additions and 10 deletions

View File

@@ -49,6 +49,21 @@ docker run -p 8080:8080 -e hapi.fhir.default_encoding=xml hapiproject/hapi:lates
HAPI looks in the environment variables for properties in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file for defaults.
### Binary storage configuration
To stream large `Binary` payloads to disk instead of the database, configure the starter with filesystem storage properties:
```
hapi:
fhir:
binary_storage_enabled: true
binary_storage_mode: FILESYSTEM
binary_storage_filesystem_base_directory: /binstore
# inline_resource_storage_below_size: 131072 # optional override
```
When `binary_storage_mode` is set to `FILESYSTEM` and `inline_resource_storage_below_size` is omitted, the starter automatically applies a 102400 byte (100 KB) inline threshold so smaller payloads remain in the database. Ensure the directory you point to is writable by the process (for Docker builds, mount it into the container with appropriate permissions).
### Configuration via overridden application.yaml file and using Docker
You can customize HAPI by telling HAPI to look for the configuration file in a different location, e.g.: