Skip to main content

JdbcHazelcastConfigurer

Configures Hazelcast for distributed crawling using a JDBC-backed data store.

Notes

Configures Hazelcast for the distributed crawler cluster using a JDBC-backed map store. Supports connection pooling, write-behind configuration, TCP member discovery, backup count, and optional Hazelcast Jet integration.

Usage

class: JdbcHazelcastConfigurer
autoDiscoveryEnabled: false
backupCount: 0
columnKeyType: string
columnValueType: string
hazelcastProperties: {}
initialLoadMode: LAZY
jdbcDriver: string
jdbcPassword: string
jdbcUrl: string
jdbcUsername: string
jetEnabled: false
maxPoolSize: 0
queueStoreEnabled: false
sqlMerge: string
tcpMembers: string
writeBatchSize: 0
writeCoalescing: false
writeDelaySeconds: 0

Properties

PropertyTypeRequiredDefault
autoDiscoveryEnabledbooleanNofalse
backupCountintegerNo-1
columnKeyTypestringNoVARCHAR(4096)
columnValueTypestringNoTEXT
hazelcastPropertiesRecord<string, string>No-
initialLoadModeenumNoLAZY
jdbcDriverstringNo-
jdbcPasswordstringNo-
jdbcUrlstringNo-
jdbcUsernamestringNosa
jetEnabledbooleanNo-
maxPoolSizeintegerNo0
queueStoreEnabledbooleanNotrue
sqlMergestringNo-
tcpMembersstringNo-
writeBatchSizeintegerNo100
writeCoalescingbooleanNotrue
writeDelaySecondsintegerNo5

Property Details

autoDiscoveryEnabled

When enabled, Hazelcast uses automatic member discovery in clustered mode instead of the explicit tcpMembers list. Default is false.

backupCount

The number of synchronous data backups in the Hazelcast cluster. Default (-1) means automatic: 0 for standalone mode, 1 for clustered mode.

columnKeyType

The SQL column type used for map and queue keys in the JDBC store schema. Default is VARCHAR(4096).

columnValueType

The SQL column type used for map values in the JDBC store schema. Default is TEXT.

hazelcastProperties

Additional Hazelcast properties to set on the configuration. These are passed directly to the Hazelcast instance and can override any internal defaults.

initialLoadMode

Controls when the Hazelcast map store loads data from the JDBC database. LAZY (default) defers loading until entries are accessed. EAGER loads all entries at cluster startup.

Allowed Values

  • LAZY
  • EAGER

jdbcDriver

The JDBC driver class name. When not set, HikariCP attempts to auto-detect the driver from the JDBC URL.

jdbcPassword

The JDBC database password. Defaults to an empty string (the H2 default).

jdbcUrl

The JDBC connection URL for the data store. In standalone mode, defaults to an embedded H2 file database in the crawler work directory. In clustered mode, this must be set explicitly to point to a shared external database.

jdbcUsername

The JDBC database username. Defaults to "sa" (the H2 default).

jetEnabled

Whether the Hazelcast Jet engine is enabled. Default (null) enables Jet for backward compatibility. Set to false when Jet is unused and a leaner cluster runtime is preferred.

maxPoolSize

The maximum JDBC connection pool size. Default (0) means automatic: 10 for standalone mode, 20 for clustered mode.

queueStoreEnabled

Whether to enable the queue store for persistence.

sqlMerge

The SQL upsert template used for map stores. The token &#123;tableName&#125; is replaced at runtime. Defaults to H2 MERGE … KEY … syntax for standalone mode and PostgreSQL INSERT … ON CONFLICT … syntax for clustered mode. Override for other database dialects.

tcpMembers

A comma-separated list of host:port addresses for TCP/IP member discovery in clustered mode (e.g., "192.168.1.10:5701,192.168.1.11:5701"). Defaults to local addresses when in clustered mode.

writeBatchSize

The batch size for write operations to the database.

writeCoalescing

Whether to coalesce write operations for better performance.

writeDelaySeconds

The write-behind delay in seconds. A value of 0 makes writes synchronous (write-through). Default is 5, which batches writes for better throughput. Pipeline coordination maps always use write-through regardless of this setting.