
Package ca.uhn.fhir.jpa.util
Class TransactionSemanticsHeader
java.lang.Object
ca.uhn.fhir.jpa.util.TransactionSemanticsHeader
This class parses and serializes the
X-Transaction-Semantics
header, which is a custom HAPI FHIR extension affecting the way that
FHIR transactions are processed.- Since:
- 8.2.0
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionWhen automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds.When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds.Specifies the number of retry attempts which should be attempted if the initial transaction processing fails with any kind of error.boolean
When processing a FHIR Batch bundle, try it as a FHIR transaction first, and only switch to batch mode on the first retry.Begin building a newTransactionSemanticsHeader
instancestatic TransactionSemanticsHeader
Parses a header value (not including the header name) into a newTransactionSemanticsHeader
instance.Serializes the values as a header value (not including the header name)
-
Field Details
-
RETRY_COUNT
- See Also:
-
MIN_DELAY
- See Also:
-
MAX_DELAY
- See Also:
-
TRY_BATCH_AS_TRANSACTION_FIRST
- See Also:
-
DEFAULT
-
HEADER_NAME
- See Also:
-
-
Method Details
-
getRetryCount
Specifies the number of retry attempts which should be attempted if the initial transaction processing fails with any kind of error. A value of 0 (or null) means that the transaction will be attempted only once (i.e. the default behaviour). A value of 2 means that the transaction will be attempted once, and if it fails, up to two more attempts will be made before giving up. -
getMinRetryDelay
When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds. -
getMaxRetryDelay
When automatically retrying a failed transaction, the system will first sleep for a minimum of this number of milliseconds. -
isTryBatchAsTransactionFirst
When processing a FHIR Batch bundle, try it as a FHIR transaction first, and only switch to batch mode on the first retry. This option is useful in cases where data can safely be ingested as a FHIR Batch, since FHIR Transaction processing is generally significantly faster. However, FHIR transactions exhibit an all-or-nothing failure mode which is not always desirable for batch ingestion, so this option provides an easy fallback which brings the benefits of both approaches. -
toHeaderValue
Serializes the values as a header value (not including the header name) -
parse
Parses a header value (not including the header name) into a newTransactionSemanticsHeader
instance. -
newBuilder
Begin building a newTransactionSemanticsHeader
instance
-