Skip to main content

Operations

What an instance does while it runs, how to tell whether it is still doing it, and the few things that have to be maintained by hand.

The model update job​

UpdateService in jeap-archrepo-web carries one scheduled job.

JobCron propertyLock name
updateModel()archrepo.update-scheduleupdate-model-task

The cron expression is required - the application does not start without it. Set it to - to disable the job.

updateModel() loads the model, reconciles systems and teams from archrepo.model, runs every registered importer sorted by getOrder(), calls ArchitectureModel.cleanup() and saves the model.

In a cluster​

ArchRepoApplication enables ShedLock with defaultLockAtMostFor = "10m", and the job declares lockAtLeastFor = "5s", lockAtMostFor = "2h". The locks are rows in the shedlock table, created by the Flyway migrations, so only one instance of a cluster runs the job even though every instance schedules it.

The scheduled method starts with LockAssert.assertLocked(): it never runs unlocked, which also covers the manual job trigger below, since the lock is applied by a method interceptor rather than by the scheduler.

If an instance dies mid-run, the lock is held for at most lockAtMostFor - two hours - before another instance may pick the job up again.

The job is transactional​

updateModel() runs in one transaction and saves once, at the end. An importer that throws therefore rolls the whole run back: nothing an earlier importer found is persisted either, and the model stays exactly as the previous successful run left it. That is the intended behaviour - a half-imported model would look like elements had disappeared from their source and get them removed - but it means one broken source blocks the whole update, so a failing importer is worth an alert rather than a shrug.

Monitoring​

The job is tracked by a SchedulerRunTracker, which persists the timestamp of the last successful run in the scheduler_run table and registers a Micrometer gauge:

GaugeJobValue
archrepo_model_update_last_run_fromupdate-modelDays since the last successful run

The value is in days, not seconds, so a daily schedule should keep the gauge at 0 or 1. Because the timestamp is persisted, the gauge survives a restart and does not reset to a healthy value when an instance is redeployed. Alert on it rising above the job's period - that is the only signal that distinguishes "the scheduler stopped" from "nothing changed".

The method is also @Timed, which yields the archrepo_model_update timer for run duration.

Triggering a job by hand​

RequestEffect
POST /api/jobs with { "type": "UPDATE_MODEL" }A full import run
POST /api/jobs/import/{importerName}One importer only, named by its simple class name, matched ignoring case

Both are @Async: the response says the job started, not that it finished. Watch the log for the outcome.

Running a single importer loads, applies onboarding and saves the model like a full run, but it does not call ArchitectureModel.cleanup() - use it to refresh one source, not as a substitute for the scheduled run.

Both need the HTTP basic credentials, see Security.

Existing Confluence documentation​

The new architecture documentation is already available from the jEAP Doc Service. After deployment, the existing Confluence documentation is deliberately left in place and will become stale. It is manually removed one week after deployment; this service no longer refreshes or cleans up those pages.

Maintenance by hand​

Systems and teams are maintained in Git under archrepo.model, not through management endpoints. Export existing metadata with GET /api/model/export, review and commit the YAML, mount it and restart. A change follows commit → deploy/restart → next model update. Both full and single-importer updates apply it. See Configuration for bootstrap, drift checks and deletion warnings. A missing or partially empty document is inert; a complete one is authoritative, so removing entries deletes them. A rename deletes the old system; its components move, with their REST APIs, OpenAPI specs and database schemas, to the system that lists the old name as an alias. A case-only edit preserves it. A document that is inconsistent in itself (duplicate names, conflicting aliases, undeclared teams) fails the startup.

Removing a wrong REST relation, for instance one a superseded Pact contract created:

DELETE /api/management/rest-api
Content-Type: application/json

{
"providerName": "foo-bar-service",
"consumerName": "foo-baz-service",
"method": "GET",
"path": "/api/bar/{id}"
}

All four fields are required. The relation is marked DELETED rather than removed, so a later import does not simply recreate it. 404 when nothing matches.

Descriptions. System descriptions belong in configuration. SystemComponent and MessageType descriptions can still be maintained directly in the database; no importer sets them.

How elements disappear again​

Removal is not one mechanism but several, which is worth knowing when something lingers or vanishes unexpectedly.

WhatRemoved byWhen
A system or teamModel onboarding before the importersA complete active configuration no longer declares it; system aggregates and cross-system relations are removed
A component the deployment log createdDeploymentlogSystemComponentImporter, at the end of its runThe deployment log no longer reports it at all - one still reported as undeployed from this environment is marked undeployed instead and kept
A component the metrics createdAWSSystemComponentImporter / RhosSystemComponentImporter, at the end of their runIts lastSeen is more than 14 days old
A REST relationArchitectureModel.cleanup(), at the end of a full runIt was imported and its lastSeen is more than 3 months old, or it was never seen
A RestApiArchitectureModel.cleanup(), at the end of a full runNo relation references it any more
An event, a command, or a Pact relationIts own importer, at the start of its runAlways - see below

Removing a component cascades: its relations, REST APIs, OpenAPI spec and database schema go with it.

The message type importer and the Pact broker importer do not diff at all. Each begins by calling removeAllByImporter() for its own Importer value and then re-imports everything from scratch, so what its source no longer reports is gone by construction. Because the whole run is one transaction, that wipe is only visible if the re-import also succeeds.

One-off work on the first start of 11.0.0​

The V2_6_0 migration fills the content_hash of every OpenAPI spec and database schema stored before the column existed. It is a single pass over both tables, reading each artifact once, and it runs like any other migration - before the service accepts requests, under Flyway's lock, recorded in flyway_schema_history. On a large landscape the first start of this version therefore takes noticeably longer; subsequent starts do no such work.