Repository navigation
Upgrade to Senzing v4, Elasticsearch 9.5.4, and Java 25 - #140
Conversation
- Migrate from the Senzing v3 G2 Java API to the v4 Java SDK (sz-sdk 4.4.2) - Upgrade elasticsearch-java to 9.5.4 and drop dependencies it now provides - Build on Java 25 with a multi-stage Dockerfile on senzingsdk-runtime:4.4.2 - Exit non-zero when any entity fails to index - Update docker-compose to the official postgres image and senzing/init-database - Update README for Senzing v4 and Kibana 9, and fix dead links
🤖 Claude Code ReviewPR review: upgrade to Senzing v4, Elasticsearch 9.5.4 and Java 25I reviewed the diff only and didn't build or run anything. The line numbers below are approximate, taken from the diff hunks. Code Quality
Testing
Documentation
Security
SummaryThere are no blocking issues. The main gaps are the lack of tests, the version mismatch between the pom and the changelog/label, the missing stack trace in the
|
- Declare jakarta.json-api and parsson explicitly instead of relying on elasticsearch-java - Simplify the export loop to a single fetchNext call - Print the stack trace for Senzing errors - Fix the README "Startup elasticsearch" list mixing bullets and numbered steps
🤖 Claude Code ReviewPR Code Review: Senzing v4, Elasticsearch 9.5.4 and Java 25 upgradeI reviewed this from the diff alone. I didn't build the project or run it, and I didn't open any files. No Code Quality
Testing
Documentation
Security
SummaryThe upgrade is solid and the Dockerfile
Automated code review analyzing defects and coding standards |
🤖 Claude Code ReviewPR Code Review: Senzing v4 / ES 9.5.4 / Java 25 upgradeI reviewed the diff only. I didn't build it or run it against Senzing or Elasticsearch. Code Quality
Testing
Documentation
Security
SummaryThe migration is clean and an improvement over the previous code. The main things to fix are:
Automated code review analyzing defects and coding standards |
🤖 Claude Code ReviewCode review: Senzing v4 / Elasticsearch 9.5.4 / Java 25 upgradeI reviewed the diff only and didn't build or run it. Line numbers are approximate, taken from the diff hunks. The test and coverage items below are ❌ because the PR adds no tests. Code quality
Testing
Documentation
Security
SummaryThe migration is well structured: the multi-stage build, the digest-pinned images, the bulk-failure accounting and the non-zero exit are all improvements. Before merging, I'd address:
Automated code review analyzing defects and coding standards |
- Bump the pom version from 1.0.0-SNAPSHOT to 2.0.0 to match the CHANGELOG and Docker label - Update the jar name in the Dockerfile - Exit 1 instead of -1 when SENZING_ENGINE_CONFIGURATION_JSON is missing
🤖 Claude Code ReviewPR Code Review: Senzing v4 / Java 25 upgrade (2.0.0)The migration is well structured. The multi-stage Docker build, the Code Quality
Testing
Documentation
Security
SummaryNothing is blocking. Before merge, I recommend these changes:
Automated code review analyzing defects and coding standards |
- Point the clone URL, GIT_REPOSITORY, and issue link at Senzing/elasticsearch-v4 - Rename the Docker image to senzing/elasticsearch-v4 to match the repository name
🤖 Claude Code ReviewPR Code Review: Senzing v4 upgrade (
|
🤖 Claude Code ReviewPR Code Review: Upgrade to Senzing v4 (2.0.0)I reviewed the diff and checked line numbers against the working tree. I did not build the project or run any tests. Code Quality
Testing
Documentation
Security
SummaryThe migration is well structured, and the multi-stage build, digest pinning, failure-aware exit code and cleanup in
Automated code review analyzing defects and coding standards |
- Rename the example Elasticsearch index from g2index to senzing-index - Rename the default Postgres database from G2 to senzing in the README and docker-compose - Pass the engine configuration to init-database as SENZING_TOOLS_CORE_SETTINGS; it does not read SENZING_TOOLS_ENGINE_CONFIGURATION_JSON - Bump the default init-database image from 0.8.8 to 0.8.9
🤖 Claude Code ReviewPR Code Review: Senzing v4 upgrade (2.0.0)I reviewed this from the diff plus a quick look at the working tree. I did not build the project or run any tests. Code Quality
Testing
Documentation
Security
SummaryThe migration is functionally sound and the failure handling is a clear improvement. The main gaps are:
Automated code review analyzing defects and coding standards |
- Default the Elasticsearch index to senzing-index and name the Senzing instance SenzingElasticSearch - Exit with status 1 and a clear message when ELASTIC_PORT is not a valid port, instead of throwing NumberFormatException - Treat a blank ELASTIC_INDEX_NAME as unset - Add JUnit unit tests for port parsing and the indexed entity document - Store the docker-compose Postgres data in a named volume instead of mounting the host's /var/lib/postgresql - Remove the broken SamMacy/elasticsearch screenshot and the trailing whitespace from the README - List the repository and image rename, exit code changes, and other changes in the CHANGELOG
🤖 Claude Code ReviewPR Code Review: Senzing v4 upgradeNo license files ( Code Quality
Testing
Documentation
Security
SummaryThe migration is sound and the behaviour changes are documented. Before merging, I'd address these:
Automated code review analyzing defects and coding standards |
…iew findings - Replace ELASTIC_HOSTNAME and ELASTIC_PORT with ELASTIC_URL, which takes the full URL so https works; credentials in the URL are passed to the client as a username and password, and are never echoed in errors - Rename the package to com.senzing.elasticsearch, the classes from G2* to Senzing*, and the jar to elasticsearch-v4.jar - Give the jar a stable name so the Dockerfile no longer repeats the project version - Remove the unused JsonFieldValueFinder class and convert the remaining classes from tabs to spaces - Report indexing failures by entity ID and error type only, and write errors to standard error - Fail when elasticsearch doesn't report on every exported entity, or when closing Senzing fails - Log Elasticsearch client warnings with slf4j-simple instead of discarding them with slf4j-nop - Extract the export loop and bulk listener so they can be unit tested; add tests for them, the URL parsing, JsonStringifier, and Utils, and add JaCoCo coverage reporting - Install the Senzing SDK under the pom's sz-sdk.version in the README instead of a hardcoded version, and document running the jar outside Docker - Mark the docker-compose Postgres and the README Elasticsearch settings as demo-only - Fix markdownlint findings in the README and list all of the changes in the CHANGELOG
🤖 Claude Code ReviewPR Review: migrate to Senzing v4 and rename to
|
- Use the raw user info so a percent-encoded ':' stays part of the username or password - Decode '+' as a literal plus sign rather than a space
🤖 Claude Code ReviewCode Review: Senzing v4 upgrade and rename (
|
- Use the Senzing entity ID as the document _id, so re-running the indexer replaces documents instead of duplicating them; document that removed entities are not deleted from the index - Skip a record's JSON_DATA when it is missing instead of failing the whole export - Remove the unused identifier helpers, which built JSON without escaping, and the unused record JSON data - Replace JsonStringifier's two near-duplicate recursive methods with one, and simplify Utils.getSimpleRawValue - Close the JSON readers
🤖 Claude Code ReviewCode Review: elasticsearch-v4 (Senzing v4 migration)I reviewed the diff only. I did not build the project or run the tests. Overall this is a clean migration with no blocking issues. Code Quality
Testing
Documentation
Security
SummaryNothing here blocks merging. Suggested follow-ups:
Automated code review analyzing defects and coding standards |
- Remove Utils.getDocumentFromJsonString and JsonStringifier.stringifyJson(String), which only tests used - Treat a blank SENZING_ENGINE_CONFIGURATION_JSON like a missing one, and name the local engineConfigJson - Import IntStream and Arrays in BulkResultListenerTest instead of using fully qualified names
🤖 Claude Code ReviewPR Code Review: Senzing v4 migration (
|
- Build the elasticsearch client from the URL's parts instead of a java.net.URI, whose getHost() is null for hostnames with underscores such as Docker container names; parse the authority directly in that case - Note that underscore hostnames work over http but not https, because elasticsearch rejects them as TLS server names - Commit the Kibana screenshot to docs/images instead of linking it from the old repository name - Replace the "X GB" disk space placeholder with the measured size of the Docker images - Update the Elastic and GitHub help links that now redirect - Replace the CONTRIBUTING placeholders with the Senzing support address, coding conventions, and testing steps
🤖 Claude Code ReviewCode reviewThe PR is a well-structured Senzing v4 migration with solid tests. I found no critical issues and no license files. Matches for Code Quality
Testing
Documentation
Security
Minor suggestions
Verdict: approve with minor suggestions.Automated code review analyzing defects and coding standards |
… date - Pass the environment and the Senzing environment factory into run(), so tests can supply their own - Add RunTest, which runs the indexer against a fake Senzing environment and a fake elasticsearch _bulk endpoint: success, the default index, an empty export, rejected documents, unreachable elasticsearch, Senzing errors, a failed close, a missing or blank configuration, and an invalid URL - Fail the build when unit tests cover less than 80% of lines; they cover 92.7% - Leave a missing DATA_SOURCE or RECORD_ID out of the indexed document instead of failing the export - Date the 2.0.0 CHANGELOG entry 2026-10-08 to match REFRESHED_AT
🤖 Claude Code ReviewCode review: Senzing v4 upgrade (
|
| Item | Result |
|---|---|
| Style conventions | ✅ The Java files use consistent 2-space indentation, and the tab-indented legacy code is gone. The m_ field prefix in SenzingEntityData.java:20-21 and SenzingRecordInfo.java:6-7 is old style, but it matches the original code. |
| No commented-out code | ✅ The old commented-out IndexRequest block was removed. The remaining comments are explanatory. |
| Meaningful names | ✅ |
| DRY | ❌ Minor. SenzingEntityData.java:42-67 builds recordInfoList and then loops over it to build recordArrayBuilder. Building the array directly in the first loop would drop the list and the SenzingRecordInfo class (SenzingRecordInfo.java). |
| Defects | ❌ See the numbered findings below. |
.claude/CLAUDE.md |
✅ Not in the diff. |
Defects and edge cases
SenzingEntityData.java:36-37: a missingRECORDSkey aborts the whole export.getJsonArray("RECORDS")returnsnull, sorecordsArray.size()throws an NPE.JSON_DATAthat isn't an object would throw aClassCastExceptionthe same way.SenzingToElastic.exportEntitiesdoesn't catch either, so a single malformed entity stops the run partway through. The changelog says records withoutJSON_DATAno longer stop the export, but this case still does.- The run does exit 1, so it isn't silent. Consider catching per entity and counting it as failed.
SenzingToElastic.java:213-216: Basic auth over plainhttp.- Credentials in an
http://ELASTIC_URLare sent in cleartext. - The README shows only the
httpsexample, but nothing stops or warns abouthttpwith credentials. Consider a stderr warning.
- Credentials in an
JsonStringifier.java: JSONnullbecomes the string"null".- This is tested in
JsonStringifierTestandSenzingEntityDataTest, but searching fornullwill match these fields. - It is probably acceptable. It is worth a README line, or skip null values.
- This is tested in
SenzingToElastic.java:79-92:ELASTIC_URLis parsed before the engine configuration is checked.- A bad URL therefore wins over a missing
SENZING_ENGINE_CONFIGURATION_JSON. - Both exit 1, so this only affects which message the user sees.
- A bad URL therefore wins over a missing
Dockerfile:46:openjdk-25-jre-headlessmust be in the base image's apt repositories.- I couldn't verify this. Confirm that the pinned
senzingsdk-runtime:4.4.2base image provides it.
- I couldn't verify this. Confirm that the pinned
Testing
| Item | Result |
|---|---|
| Unit tests for new functions | ✅ BulkResultListener, JsonStringifier, SenzingEntityData, Utils, ElasticUrl.parse, createClient, exportEntities and indexOperation all have tests. |
| Integration tests | ✅ RunTest runs the whole indexer against a fake Senzing environment and a local _bulk HTTP server. It covers success, rejected documents, an unreachable server, Senzing errors, a failed destroy and invalid configuration. |
| Edge cases | ✅ These are well covered: empty export, missing record keys, underscore hostnames, IPv6, and percent-encoded credentials. |
| Coverage above 80% | ✅ JaCoCo enforces 80% line coverage in pom.xml and fails the build below that. I did not measure the actual figure. main() and createSzEnvironment are untested but small. |
Test nits:
RunTest.java:~216usesassertEquals(null, created.get()). UseassertNull.SenzingEntityDataTest.parsedoesn't close theJsonReader. Use try-with-resources, asJsonStringifierTestdoes.- There is no test for the missing-
RECORDScase (defect 1).
Documentation
| Item | Result |
|---|---|
| README updated | ✅ It covers ELASTIC_URL, TLS and truststore setup, the build outside Docker, and the _id replacement semantics. It also notes that stale documents are never deleted. |
| API docs | ✅ N/A. |
| Inline comments | ✅ The URL-parsing workaround for underscore hostnames and the Class-Path choice in the pom are both explained. |
CHANGELOG.md |
✅ A 2.0.0 entry is present. The Dockerfile version label and pom.xml version both match it. |
| Markdown / CommonMark | ✅ The README list indentation was normalized to Prettier style. Two things to check: the README no longer ends with a trailing blank line, and the link definitions [Elasticsearch], [kibana], [quickstart] and [Documentation issue] appear to be unused. Run Prettier and markdownlint to confirm. |
Security
| Item | Result |
|---|---|
| No hardcoded credentials | ✅ The compose file defaults postgres/postgres, with a demo-only warning at the top of the file. Acceptable for a demo. |
| Input validation | ✅ ElasticUrl.parse validates the scheme, host, port and syntax. |
| Error handling | ✅ Failures give a non-zero exit code, and destroy runs in finally. See defect 1 for the gap. |
| No sensitive data in logs | ✅ Bad-URL errors don't echo the value, which is tested. Bulk failures log only the entity ID and error type, also tested. |
| License files | ✅ No .lic files or AQAAAD strings in the diff. |
Summary
This is a solid upgrade with strong tests. Before merging, I'd handle defect 1 (per-entity parse robustness) and confirm the openjdk-25-jre-headless package exists in the base image (defect 5). The rest are minor.
Automated code review analyzing defects and coding standards
- Index an entity whose export has no RECORDS with empty JSON_DATA and RECORDS, instead of failing the export - Note in the README that credentials in an http URL are sent unencrypted
🤖 Claude Code ReviewPR Code Review: Senzing v4 upgrade (
|
Summary
Upgrades this demo from Senzing v3 to Senzing v4, and brings Elasticsearch, Java and the build tooling to their latest versions.
G2toElasticnow uses the v4 Java SDK (SzCoreEnvironment/SzEngine) instead ofG2JNI. The exported entity JSON is unchanged, soG2EntityDataneeded no logic changes. The v4 SDK isn't on Maven Central: the Docker build installs thesz-sdk.jarthat ships insenzing/senzingsdk-runtime, and at runtime the jar uses the image's own SDK through its manifestClass-Path.elasticsearch-java9.4.5 → 9.5.4, using the client's built-in transport. Removed dependencies it now provides or that were unused:elasticsearch-rest-client,jackson-*,javax.json(moved tojakarta.json),commons-csv,commons-io.senzingsdk-runtime:4.4.2. The Maven stage runs on the build platform, so multi-arch CI builds don't compile under emulation.bitnami/postgresql→ officialpostgres:18, andsenzing-tools→senzing/init-database:0.8.8, with v4 paths.docker runsteps replacing a dead link, Kibana 9 UI steps, and fixed dead links.Testing
All of these were run locally in Docker:
docker buildx build(linux/amd64,linux/arm64, SBOM + provenance), matching thedocker-build-containerworkflow. Both images indexed 18 of 18 entities.docker compose up: Postgres 18 plusinit-databasecreates the v4 schema and data sources.g2indexdata view, see 18 documents in Discover, and a Lucene fuzzy searchJSON_DATA.NAME_FULL:Perez~1returns "Juan Pérez"..vscode/cspell.json: no issues. hadolint: no new findings.Notes
elasticsearch-java9.5.4, andelasticsearch-rest-clientis no longer used.Resolves #138
Resolves #139