diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index d2c17731195..4eb78edfb61 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -37,31 +37,7 @@
-
-
-
- org.ow2.asm
- asm-all
- 5.0.4
-
- org.basepom.maven
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java
index 410e995d9f5..f8518e3a3f0 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java
@@ -226,6 +226,11 @@ public class RequestPartitionId {
return fromPartitionIds(Collections.singletonList(null));
}
+ @Nonnull
+ public static RequestPartitionId defaultPartition(@Nullable LocalDate thePartitionDate) {
+ return fromPartitionIds(Collections.singletonList(null), thePartitionDate);
+ }
+
@Nonnull
public static RequestPartitionId fromPartitionId(@Nullable Integer thePartitionId) {
return fromPartitionIds(Collections.singletonList(thePartitionId));
@@ -238,7 +243,12 @@ public class RequestPartitionId {
@Nonnull
public static RequestPartitionId fromPartitionIds(@Nonnull Collection thePartitionIds) {
- return new RequestPartitionId(null, toListOrNull(thePartitionIds), null);
+ return fromPartitionIds(thePartitionIds, null);
+ }
+
+ @Nonnull
+ public static RequestPartitionId fromPartitionIds(@Nonnull Collection thePartitionIds, @Nullable LocalDate thePartitionDate) {
+ return new RequestPartitionId(null, toListOrNull(thePartitionIds), thePartitionDate);
}
@Nonnull
diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties
index fdff9a69951..571dd26a636 100644
--- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties
+++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties
@@ -164,7 +164,7 @@ ca.uhn.fhir.jpa.patch.JsonPatchUtils.failedToApplyPatch=Failed to apply JSON pat
ca.uhn.fhir.jpa.graphql.JpaStorageServices.invalidGraphqlArgument=Unknown GraphQL argument "{0}". Value GraphQL argument for this type are: {1}
-ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.blacklistedResourceTypeForPartitioning=Resource type {0} can not be partitioned
+ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.nonDefaultPartitionSelectedForNonPartitionable=Resource type {0} can not be partitioned
ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.unknownPartitionId=Unknown partition ID: {0}
ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.unknownPartitionName=Unknown partition name: {0}
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2407-allow-partition-date-for-nonpartitionable.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2407-allow-partition-date-for-nonpartitionable.yaml
new file mode 100644
index 00000000000..b8942a6f558
--- /dev/null
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_4_0/2407-allow-partition-date-for-nonpartitionable.yaml
@@ -0,0 +1,6 @@
+---
+type: add
+issue: 2407
+title: "When using the JPA server in partitioned mode with a partition interceptor, the interceptor is now called even for
+ resource types that can not be placed in a non-default partition (e.g. SearchParameter, CodeSystem, etc.). The interceptor
+ may return null or default in this case, but can include a non-null partition date if needed."
diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
index b7806c5713b..2bb299f0bcd 100644
--- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
+++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa_partitioning/partitioning.md
@@ -82,6 +82,25 @@ A hook against the [`Pointcut.STORAGE_PARTITION_IDENTIFY_READ`](/hapi-fhir/apido
As of HAPI FHIR 5.3.0, the *Identify Partition for Read* hook method may return multiple partition names or IDs. If more than one partition is identified, the server will search in all identified partitions.
+## Non-Partitionable Resources
+
+Some resource types can not be placed in any partition other than the DEFAULT partition. When a resource of one of these types is being created, the *STORAGE_PARTITION_IDENTIFY_CREATE* pointcut is invoked, but the hook method must return [defaultPartition()](https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/interceptor/model/RequestPartitionId.html#defaultPartition()). A partition date may optionally be included.
+
+The following resource types may not be placed in any partition except the default partition:
+
+* CapabilityStatement
+* CodeSystem
+* CompartmentDefinition
+* ConceptMap
+* NamingSystem
+* OperationDefinition
+* Questionnaire
+* SearchParameter
+* StructureDefinition
+* StructureMap
+* Subscription
+* ValueSet
+
## Examples
See [Partition Interceptor Examples](./partition_interceptor_examples.html) for various samples of how partitioning interceptors can be set up.
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/RequestPartitionHelperSvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/RequestPartitionHelperSvc.java
index ebd15af2a7e..37da051117a 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/RequestPartitionHelperSvc.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/partition/RequestPartitionHelperSvc.java
@@ -50,7 +50,7 @@ import static ca.uhn.fhir.jpa.util.JpaInterceptorBroadcaster.hasHooks;
public class RequestPartitionHelperSvc implements IRequestPartitionHelperSvc {
- private final HashSet