-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hello HAPI FHIR team,
I am seeking help with a persistent issue regarding subscription configuration in the hapi-fhir-jpaserver-starter project. My goal is to disable the InMemorySubscriptionMatcher to use the default DatabaseSubscriptionMatcher for rest-hook notifications.
Despite extensive debugging, I have been unable to change this behavior.
Environment:
Project: hapi-fhir-jpaserver-starter
Deployment: Running as a systemd service on a Linux server.
Execution command: java -jar /path/to/target/ROOT.war
Symptom:
Every Subscription resource created via the REST API is systematically assigned the following meta.tag, indicating that the in-memory strategy is being used:{ "system": "http://hapifhir.io/fhir/StructureDefinition/subscription-matching-strategy", "code": "IN_MEMORY" }
As a result, no notifications are ever delivered, and the logs show the background job attempting to submit "0 resources".
Debugging Steps Performed (All Unsuccessful):
I have tried every standard Spring Boot configuration method to override the default behavior, without success.
Internal application.yaml Configuration:
Modified src/main/resources/application.yaml to include both hapi.fhir.subscription.matcher.in-memory-enabled: false and later hapi.fhir.subscription.enable-in-memory-subscription-matching: false.
Performed a full project rebuild with mvn clean package after each change (including manually deleting the previous ROOT.war to ensure freshness).
Result: No effect. The IN_MEMORY tag persisted.
External Configuration (via --spring.config.location):
Modified the systemd service file to launch with the argument --spring.config.location=file:/etc/hapi-fhir/application.yaml.
The external file's path, content, and permissions were triple-checked and confirmed to be correct.
Result: No effect. The argument appears to be ignored.
External Configuration (via Convention):
Placed the application.yaml file in a config/ directory adjacent to the ROOT.war (/target/config/application.yaml).
Result: No effect. The file appears to be ignored.
External Configuration (via Command-Line Argument Override):
Modified the systemd service to launch with --hapi.fhir.subscription.enabled=true and --hapi.fhir.subscription.enable-in-memory-subscription-matching=false.
Result: The enabled=true argument worked (a "Subscriptions are disabled" log message disappeared), but the argument to disable the in-memory matcher was ignored.
Diagnostics via Spring Boot Actuator:
Enabled the /actuator/env endpoint via a command-line argument.
Querying this endpoint revealed that no property related to in-memory-enabled was present in the application's loaded environment, suggesting the application is falling back to a hard-coded default.
Final Conclusion:
The evidence strongly suggests that this version of the hapi-fhir-jpaserver-starter contains a Java-based configuration (@Configuration/@bean) that programmatically and unconditionally enables the InMemorySubscriptionMatcher. This Java configuration seems to take precedence over all standard Spring Boot configuration methods.
My Question:
Is there a specific, and perhaps undocumented, configuration property to disable this behavior? Or is modifying the Java source code the only way to enable the database-backed subscription matcher in this project?
Thank you for your time and for maintaining this excellent project. Any guidance would be greatly appreciated.
PS: To make this report as clear and comprehensive as possible, I used an AI assistant to help structure this message in English. Please be assured that I personally drove the entire debugging process and have carefully reviewed and edited this text to ensure it is an exact reflection of my situation.