Class HibernateOrmMapperOutboxPollingSettings
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Configuration property keys without theprefix
+HibernateOrmMapperOutboxPollingSettings.Radicals.COORDINATION_PREFIX
.static final class
Default values for the different settings if no values are given.static final class
Configuration property keys without theprefix
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The database catalog to use for the agent table.static final String
The database schema to use for the agent table.static final String
The name of the agent table.static final String
The name of UUID generator strategy to be used byUuidGenerator
for the agent table.static final String
The name of theHibernate ORM constant type code used to identify a generic SQL type
used for representing an UUID in the agent table.static final String
The database catalog to use for the outbox event table.static final String
The database schema to use for the outbox event table.static final String
The name of the outbox event table.static final String
The name of UUID generator strategy to be used byUuidGenerator
for the outbox event table.static final String
The name of theHibernate ORM constant type code used to identify a generic SQL type
used for representing an UUID in the outbox event table.static final String
In the event processor, how many outbox events, at most, are processed in a single transaction.static final String
Whether the application will process entity change events.static final String
In the event processor, the order in which outbox events are processed.static final String
In the event processor, how long to wait for another query to the outbox events table after a query didn't return any event, in milliseconds.static final String
How long, in milliseconds, an event processor "pulse" remains valid before considering the agent disconnected and forcibly removing it from the cluster.static final String
How long, in milliseconds, the event processor can poll for events before it must perform a "pulse".static final String
How long the event processor must wait before re-processing an event after its processing failed.static final String
The indices of shards assigned to this application node for event processing.static final String
The total number of shards across all application nodes for event processing.static final String
In the event processor, the timeout for transactions processing outbox events.static final String
In the mass indexer, how long to wait for another query to the agent table when actively waiting for event processors to suspend themselves, in milliseconds.static final String
How long, in milliseconds, a mass indexer agent "pulse" remains valid before considering the agent disconnected and forcibly removing it from the cluster.static final String
How long, in milliseconds, the mass indexer can wait before it must perform a "pulse".static final String
The name of the outbox polling strategy, to be set on theHibernateOrmMapperSettings.COORDINATION_STRATEGY
configuration property in order to use this strategy.static final String
The root property for coordination properties specific to a tenant, e.g.static final String
The prefix expected for the key of every Hibernate Search configuration property when using the Hibernate ORM mapper. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
coordinationKey
(String radical) Builds a configuration property key for coordination, with the given radical.static String
coordinationKey
(String tenantId, String radical) Builds a configuration property key for coordination for the given tenant, with the given radical.
-
Field Details
-
PREFIX
The prefix expected for the key of every Hibernate Search configuration property when using the Hibernate ORM mapper.- See Also:
-
COORDINATION_STRATEGY_NAME
The name of the outbox polling strategy, to be set on theHibernateOrmMapperSettings.COORDINATION_STRATEGY
configuration property in order to use this strategy.With outbox polling, one or multiple application nodes exist, and they coordinate with each other by pushing data to additional tables in the database and polling these tables.
See the reference documentation for a comparison of all available coordination strategies and possible architectures.
- See Also:
-
COORDINATION_TENANTS
The root property for coordination properties specific to a tenant, e.g. "hibernate.search.coordination.tenants.tenant1.something = somevalue".- See Also:
-
COORDINATION_EVENT_PROCESSOR_ENABLED
Whether the application will process entity change events.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Expects a Boolean value such as
true
orfalse
, or a string that can be parsed into a Boolean value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_ENABLED
.When the event processor is disabled, events will still be produced by this application node whenever an entity changes, but indexing will not happen on this application node and is assumed to happen on another node.
- See Also:
-
COORDINATION_EVENT_PROCESSOR_SHARDS_TOTAL_COUNT
The total number of shards across all application nodes for event processing.WARNING: This property must have the same value for all application nodes, and must never change unless all application nodes are stopped, then restarted. Failing that, some events may not be processed or may be processed twice or in the wrong order, resulting in errors and/or out-of-sync indexes.
Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
When this property is set, "hibernate.search.coordination.event_processor.shards.assigned" must also be set.
Expects an Integer value of at least
2
, or a String that can be parsed into such Integer value.No default: must be provided explicitly if you want static sharding.
- See Also:
-
COORDINATION_EVENT_PROCESSOR_SHARDS_ASSIGNED
The indices of shards assigned to this application node for event processing.WARNING: shards must be uniquely assigned to one and only one application nodes. Failing that, some events may not be processed or may be processed twice or in the wrong order, resulting in errors and/or out-of-sync indexes.
Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
When this property is set, "hibernate.search.coordination.event_processor.shards.total_count" must also be set.
Expects a shard index, i.e. an Integer value between
0
(inclusive) and thetotal shard count
(exclusive), or a String that can be parsed into such shard index, or a String containing multiple such shard index strings separated by commas, or aCollection<Integer>
containing such shard indices.No default: must be provided explicitly if you want static sharding.
- See Also:
-
COORDINATION_EVENT_PROCESSOR_POLLING_INTERVAL
In the event processor, how long to wait for another query to the outbox events table after a query didn't return any event, in milliseconds.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Hibernate Search will wait that long before polling again if the last polling didn't return any event:
- High values mean higher latency between an entity change and the corresponding update in the index, but less stress on the database when there are no events to process.
- Low values mean lower latency between an entity change and the corresponding update in the index, but more stress on the database when there are no events to process.
Expects a positive Integer value in milliseconds, such as
1000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_POLLING_INTERVAL
.- See Also:
-
COORDINATION_EVENT_PROCESSOR_PULSE_INTERVAL
How long, in milliseconds, the event processor can poll for events before it must perform a "pulse".Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Every agent registers itself in a database table. Regularly, while polling for events to process, the event processor performs a "pulse": it pauses indexing and:
- It updates its own entry in the table, to let other agents know it's still alive and prevent an expiration
- It removes any other agents that expired from the table
- It suspends itself if it notices a mass indexer is running
- It performs rebalancing (reassignment of shards) if the number of agents participating in background indexing changed since the last pulse
The pulse interval must be set to a value between the
polling interval
and one third (1/3) of theexpiration interval
:- Low values (closer to the polling interval) mean less time wasted not processing events when a node joins or leaves the cluster, and reduced risk of wasting time not processing events because an event processor is incorrectly considered disconnected, but more stress on the database because of more frequent checks of the list of agents.
- High values (closer to the expiration interval) mean more time wasted not processing events when a node joins or leaves the cluster, and increased risk of wasting time not processing events because an event processor is incorrectly considered disconnected, but less stress on the database because of less frequent checks of the list of agents.
Expects a positive Integer value in milliseconds, such as
2000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_PULSE_INTERVAL
.- See Also:
-
COORDINATION_EVENT_PROCESSOR_PULSE_EXPIRATION
How long, in milliseconds, an event processor "pulse" remains valid before considering the agent disconnected and forcibly removing it from the cluster.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Every agent registers itself in a database table. Regularly, while polling for events to process, mass indexer agent performs a
"pulse"
: it pauses what it was doing and (among other things) updates its entry in the table, to let other agents know it's still alive and prevent an expiration. If an agent fails to update its entry for longer than the value of the expiration interval, it will be considered disconnected: other agents will forcibly remove its entry from the table, and will perform rebalancing (reassign shards) as necessary.The expiration interval must be set to a value at least 3 times larger than the
pulse interval
:- Low values (closer to the pulse interval) mean less time wasted not processing events when a node abruptly leaves the cluster due to a crash or network failure, but increased risk of wasting time not processing events because an event processor is incorrectly considered disconnected.
- High values (much larger than the pulse interval) mean more time wasted not processing events when a node abruptly leaves the cluster due to a crash or network failure, but reduced risk of wasting time not processing events because an event processor is incorrectly considered disconnected.
Expects a positive Integer value in milliseconds, such as
30000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_PULSE_EXPIRATION
.- See Also:
-
COORDINATION_EVENT_PROCESSOR_ORDER
In the event processor, the order in which outbox events are processed.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Expects one of the "external representation" strings defined in
OutboxEventProcessingOrder
.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_ORDER
.- See Also:
-
COORDINATION_EVENT_PROCESSOR_BATCH_SIZE
In the event processor, how many outbox events, at most, are processed in a single transaction.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Expects a positive Integer value, such as
50
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_BATCH_SIZE
.- See Also:
-
COORDINATION_EVENT_PROCESSOR_TRANSACTION_TIMEOUT
In the event processor, the timeout for transactions processing outbox events.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Only effective when a JTA transaction manager is configured.
Expects a positive Integer value in seconds, such as
10
, or a String that can be parsed into such Integer value.When using JTA and this property is not set, Hibernate Search will use whatever default transaction timeout is configured in the JTA transaction manager.
- See Also:
-
COORDINATION_EVENT_PROCESSOR_RETRY_DELAY
How long the event processor must wait before re-processing an event after its processing failed.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Expects a positive integer value in seconds, such as
10
, or a String that can be parsed into such Integer value.Use the value
0
to reprocess the failed events as soon as possible, with no delay.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_EVENT_PROCESSOR_RETRY_DELAY
.- See Also:
-
COORDINATION_MASS_INDEXER_POLLING_INTERVAL
In the mass indexer, how long to wait for another query to the agent table when actively waiting for event processors to suspend themselves, in milliseconds.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Hibernate Search will wait that long before polling again when it finds other agents haven't suspended yet:
- Low values will reduce the time it takes for the mass indexer agent to detect that event processors finally suspended themselves, but will increase the stress on the database while the mass indexer agent is actively waiting.
- High values will increase the time it takes for the mass indexer agent to detect that event processors finally suspended themselves, but will reduce the stress on the database while the mass indexer agent is actively waiting.
Expects a positive Integer value in milliseconds, such as
1000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_MASS_INDEXER_POLLING_INTERVAL
.- See Also:
-
COORDINATION_MASS_INDEXER_PULSE_INTERVAL
How long, in milliseconds, the mass indexer can wait before it must perform a "pulse".Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Every agent registers itself in a database table. Regularly, the mass indexer performs a "pulse":
- It updates its owm entry in the table, to let other agents know it's still alive and prevent an expiration
- It removes any other agents that expired from the table
The pulse interval must be set to a value between the
polling interval
and one third (1/3) of theexpiration interval
:- Low values (closer to the polling interval) mean reduced risk of event processors starting to process events again during mass indexing because a mass indexer agent is incorrectly considered disconnected, but more stress on the database because of more frequent updates of the mass indexer agent's entry in the agent table.
- High values (closer to the expiration interval) mean increased risk of event processors starting to process events again during mass indexing because a mass indexer agent is incorrectly considered disconnected, but less stress on the database because of less frequent updates of the mass indexer agent's entry in the agent table.
Expects a positive Integer value in milliseconds, such as
2000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_MASS_INDEXER_PULSE_INTERVAL
.- See Also:
-
COORDINATION_MASS_INDEXER_PULSE_EXPIRATION
How long, in milliseconds, a mass indexer agent "pulse" remains valid before considering the agent disconnected and forcibly removing it from the cluster.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Every agent registers itself in a database table. Regularly, while polling for events to process, each agent performs a
"pulse"
: it pauses what it was doing and (among other things) updates its entry in the table, to let other agents know it's still alive and prevent an expiration. If an agent fails to update its entry for longer than the value of the expiration interval, it will be considered disconnected: other agents will forcibly remove its entry from the table, and will resume their work as if the expired agent didn't exist.The expiration interval must be set to a value at least 3 times larger than the
pulse interval
:- Low values (closer to the pulse interval) mean less time wasted with event processors not processing events when a mass indexer agent terminates due to a crash, but increased risk of event processors starting to process events again during mass indexing because a mass indexer agent is incorrectly considered disconnected.
- High values (much larger than the pulse interval) mean more time wasted with event processors not processing events when a mass indexer agent terminates due to a crash, but reduced risk of event processors starting to process events again during mass indexing because a mass indexer agent is incorrectly considered disconnected.
Expects a positive Integer value in milliseconds, such as
30000
, or a String that can be parsed into such Integer value.Defaults to
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_MASS_INDEXER_PULSE_EXPIRATION
.- See Also:
-
COORDINATION_ENTITY_MAPPING_OUTBOXEVENT_CATALOG
The database catalog to use for the outbox event table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Defaults to the default catalog configured in Hibernate ORM. See
MappingSettings.DEFAULT_CATALOG
.- See Also:
-
COORDINATION_ENTITY_MAPPING_OUTBOXEVENT_SCHEMA
The database schema to use for the outbox event table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Defaults to the default schema configured in Hibernate ORM. See
MappingSettings.DEFAULT_SCHEMA
.- See Also:
-
COORDINATION_ENTITY_MAPPING_OUTBOXEVENT_TABLE
The name of the outbox event table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is "HSEARCH_OUTBOX_EVENT".
- See Also:
-
COORDINATION_ENTITY_MAPPING_OUTBOXEVENT_UUID_GEN_STRATEGY
The name of UUID generator strategy to be used byUuidGenerator
for the outbox event table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_ENTITY_MAPPING_OUTBOX_EVENT_UUID_GEN_STRATEGY
. -
COORDINATION_ENTITY_MAPPING_OUTBOXEVENT_UUID_TYPE
The name of theHibernate ORM constant type code used to identify a generic SQL type
used for representing an UUID in the outbox event table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_ENTITY_MAPPING_OUTBOX_EVENT_UUID_TYPE
.- See Also:
-
COORDINATION_ENTITY_MAPPING_AGENT_CATALOG
The database catalog to use for the agent table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Defaults to the default catalog configured in Hibernate ORM. See
MappingSettings.DEFAULT_CATALOG
.- See Also:
-
COORDINATION_ENTITY_MAPPING_AGENT_SCHEMA
The database schema to use for the agent table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
Defaults to the default schema configured in Hibernate ORM. See
MappingSettings.DEFAULT_SCHEMA
.- See Also:
-
COORDINATION_ENTITY_MAPPING_AGENT_TABLE
The name of the agent table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is "HSEARCH_AGENT".
- See Also:
-
COORDINATION_ENTITY_MAPPING_AGENT_UUID_GEN_STRATEGY
The name of UUID generator strategy to be used byUuidGenerator
for the agent table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_ENTITY_MAPPING_AGENT_UUID_GEN_STRATEGY
. -
COORDINATION_ENTITY_MAPPING_AGENT_UUID_TYPE
The name of theHibernate ORM constant type code used to identify a generic SQL type
used for representing an UUID in the agent table.Only available when "hibernate.search.coordination.strategy" is "outbox-polling".
The default for this value is
HibernateOrmMapperOutboxPollingSettings.Defaults.COORDINATION_ENTITY_MAPPING_AGENT_UUID_TYPE
.- See Also:
-
-
Method Details
-
coordinationKey
Builds a configuration property key for coordination, with the given radical.See
HibernateOrmMapperOutboxPollingSettings.CoordinationRadicals
for available radicals.Example result: "
hibernate.search.coordination.tenant.myTenant.event_processor.enabled
"- Parameters:
radical
- The radical of the configuration property (see constants inHibernateOrmMapperOutboxPollingSettings.CoordinationRadicals
)- Returns:
- the concatenated prefix + tenant ID + radical
-
coordinationKey
Builds a configuration property key for coordination for the given tenant, with the given radical.See
HibernateOrmMapperOutboxPollingSettings.CoordinationRadicals
for available radicals.Example result: "
hibernate.search.coordination.tenant.myTenant.event_processor.enabled
"- Parameters:
tenantId
- The identifier of the tenant whose coordination to configure, ornull
to configure defaults.radical
- The radical of the configuration property (see constants inHibernateOrmMapperOutboxPollingSettings.CoordinationRadicals
)- Returns:
- the concatenated prefix + tenant ID + radical
-