Architecture
The Auto Configuration Server (ACS) measures the devices. The FCC Service owns the campaigns and the verdicts.
Why the ACS link is queues only
The ACS and the FCC Service do not know each other. There is no SOAP client and no REST call between them. Neither configuration holds the address of the other. The only channel is a fixed set of five Hazelcast queues. See Hazelcast queues.
This design gives three benefits:
Independent releases: each side ships on its own schedule. The queue message is the only coupling.
One contract: every queue has exactly one message shape. The shape is defined once and copied into both repositories.
No impact on Group Update: the FCC code in the ACS is a separate module. The old fcc code and Update Group stay untouched.
|
The design has a real cost. There is no immediate accept or reject.
The service puts an Three rules compensate:
|
No authentication of its own
The FCC Service has no authentication. It has no user store and no tokens. Two rules protect it instead:
-
The service port stays inside the Docker network. Nothing maps it to the host or to an ingress.
-
The portal reaches the service only through the UI Backend. The UI Backend authenticates the user, resolves the domain scope and adds the identity headers.
The service trusts those headers without a check.
A request without the X-FT-Domain-Scope header is refused with HTTP 403.
The service never falls back to a default scope.
See Identity contract.
FCC diagnostics has no role model. Access means one thing: the FCC menu item is visible in the portal. Inside the service the domain scope is the only further limit.
Why the service keeps an audit trail
Every caller may create, activate, stop, pause and delete any campaign in a visible domain. No permission can prevent an action, so the service records who acted and when.
The four audit columns on each table are not enough. They show the last writer of a row, and a deleted campaign leaves no row. Lifecycle actions therefore go to a separate append-only trail. See fcc_audit.
An empty user_id means the service acted by itself.
The scheduled-campaign poller and the daily reactivation create runs without a user request.
Schema ownership
The service uses four schemas under four different rules.
| Schema | Access | Rule |
|---|---|---|
|
Read and write |
Owned by this service. Liquibase migrates it, and nothing else does. See ftfcc schema. |
|
Read-only |
Owned by the ACS. A dedicated account holds |
ClickHouse |
Shared |
Quality of Experience (QoE) monitoring already owns |
|
Read-only, optional |
Owned by the UI Backend. The service reads two tables for the saved device conditions. The pool is lazy and has no transaction manager. Without this grant the service starts and refuses only one device source. See The iotw grant. |
Liquibase cannot run on the ftacs schema.
Liquibase needs to create and lock its own two tables, and the read-only account has no such rights.
The service checks the schema at startup instead.
One catalog query per database vendor confirms every table and column.
See Startup checks.
The same check runs for the two iotw tables.
There it only warns, because a missing grant costs one device source and not the service.
See The iotw grant check.
Campaign states
The portal shows the state of every campaign.
| State | Meaning |
|---|---|
Not active |
The campaign is idle. It never ran, or an operator stopped it. You can activate it again. |
Scheduled |
An operator booked a start time. The campaign waits for that time. |
Running |
A run is live on the fleet. |
Scheduled for reactivation |
A daily campaign finished one run and waits for the next day. |
Paused |
An operator paused the campaign and means to come back to it. The live run is already stopped. |
Stopped |
The ACS or an outage ended the run. Nobody asked for it. |
Completed |
Every planned run finished. |
Error |
The run failed. The ACS refused the command, or it reported a failure. |
Archived |
The campaign comes from the legacy FCC import. You cannot run, schedule or edit it. |
Two states look similar and are not:
Not active: the operator stopped the campaign.
Stopped: something else stopped it.
A stop and a pause do the same work on the fleet. Both clear the booked time, stop the live run and cancel the planned runs. A pause differs in one point only: it records that the operator means to return. Neither state keeps a position, so a new activation always starts a new run.
Run states
A run is one execution of a campaign. The portal reports a run state per run.
| State | Meaning |
|---|---|
Planned |
The service created the run for a future day. It sent no command yet. |
Dispatching |
The command is on the queue. The service waits for the acknowledgement of the ACS. |
Running |
The ACS measures the fleet. |
Stopping |
A stop is sent. Measurements from devices in flight still arrive. |
Stopped |
The run ended after a stop. |
Finished |
The run completed its window. |
Failed |
The ACS refused the command, or it reported a failure. |
A stopped run never reopens. A finished run never reopens. Late reports from the ACS are logged and dropped. Reports from a closed run must not change a regulatory report.
Component view
One thread reads each inbound queue: fccCommandAck, fccResultQueue, fccDeviceStateQueue and fccActivationEventQueue.
See Messaging for the full queue specification.
State transitions
Every change of a campaign state and of a run state follows one of the two tables below. Any combination outside a table is refused.
A refusal is a normal outcome and not a failure. A Hazelcast queue delivers every message at least once. Two producers share no order. A republished command therefore produces a second acknowledgement. An ACS after a failover reports a run this service closed minutes ago.
A refused queue message is logged and dropped. A refused user request answers HTTP 409 and names the state.
What a transition writes
A transition writes more than the state column. The table below names every further write. The service performs the write in the same transaction as the state change.
| Table | Effect | What the service writes |
|---|---|---|
|
|
Sets |
|
|
Writes the requested instant. The instant always comes from the request. |
|
|
Creates the next run as a |
|
|
Stops the run the campaign owns now. The service finds that run by a query, so it may differ from the run of the current event. |
|
|
Writes |
|
|
Sets |
|
|
Writes |
|
|
Writes |
|
|
Writes a STOP into |
Campaign transition table
The table below is the specification. Any combination outside it is refused.
| From | Event | To | Effects |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
— |
|
|
|
|
|
|
|
— |
|
|
anything |
denied |
terminal and unreachable |
Five rows carry more than the table shows.
RUNNING plus ACTIVATION_STARTED stays RUNNING on purpose.
The service applies the acknowledgement first, so the start event only confirms a known fact.
The confirmation may arrive twice.
The service accepts the repeat instead of logging a denial.
USER_STOP leads to NOT_ACTIVE.
Group Update behaves the same way: its stop returns the group to the Not active state.
STOPPED is the word of the ACS, not the word of the operator.
RUNNING plus ACTIVATION_STOPPED leads to STOPPED, and only an unplanned end reaches this row.
Three sources can feed the event: the run event consumer, the device state drain and the stop grace watchdog.
All three skip the event after a stop or a pause by an operator.
That guard also protects a pause.
Without it an ACTIVATION_STOPPED would turn a pause into a stop.
See Run events.
PAUSED plus USER_STOP leads to NOT_ACTIVE, and PAUSED is the only closed state with a stop.
A stop of an already closed campaign answers HTTP 409 and names the state.
That answer tells an operator with forty campaigns that somebody else closed one a minute earlier.
A pause is different: the operator is meant to leave that state.
A second USER_PAUSE stays denied, because nothing would change.
NOT_ACTIVE, PAUSED, STOPPED, ERROR and COMPLETED deny the three run events and still accept the two activate events.
Re-running a closed campaign is a normal operation.
Every run is its own row with its own settings snapshot.
Stopping a paused campaign carries CLEAR_SCHEDULED_AT and no STOP_ACTIVE_ACTIVATION.
A pause leaves nothing on the ACS to stop.
A stop and a pause run the same work on the fleet.
By the time a campaign is PAUSED, every activation of the live run is closed locally or has a STOP on the ACS.
Every planned reactivation is closed with it.
A run in the STOPPING state gets no second stop.
Such a run drains under ft.fcc.stop-grace with its STOP already sent.
A second command would burn a command sequence and repeat an instruction in progress.
Nothing can reopen the gap.
PAUSED denies SCHEDULE_DUE and REACTIVATION_DUE.
An activate event leaves PAUSED in the same transaction.
One consequence matters here.
The draining run keeps stop_reason = USER_PAUSE, because the stop finds nothing to stamp again.
The later ACTIVATION_STOPPED therefore never reaches the campaign, and a stopped campaign cannot move to STOPPED.
SCHEDULED_FOR_REACTIVATION plus ACTIVATE_IMMEDIATELY also carries STOP_ACTIVE_ACTIVATION.
A campaign between daily runs already owns the next run as a PLANNED row.
The operator asks for a different run now.
An abandoned row costs more than tidiness.
The campaign moves to RUNNING, so RUNNING plus REACTIVATION_DUE is denied and the row stays PLANNED.
The reactivation poller then claims that row on every tick forever.
A row already in DISPATCHING or RUNNING is worse: it keeps measuring under a campaign on a different run.
A PLANNED row is closed locally with no command.
A DISPATCHING or RUNNING row takes the normal STOP_REQUESTED path with a STOP for the ACS.
Two details of that stop matter.
-
It happens before
fcc_test.command_seqis raised for the new run. The STOP must take the lower sequence number. Otherwise the ACS discards the newACTIVATEas stale. -
The reason is
USER_STOPand notERROR. An operator ended the old run, and nothing failed. That reason also keeps the laterACTIVATION_STOPPEDaway from the campaign.
ARCHIVED is unreachable in both directions.
Only the legacy import writes it, for campaigns finished years ago in the old product.
Nothing leads to ARCHIVED and nothing leads out of it.
Run transition table
A dash in the Stop reason column means null.
Null means leave stop_reason unchanged, not clear it.
| From | Event | To | Stop reason | Effects |
|---|---|---|---|---|
|
|
|
— |
— |
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
— |
— |
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from the context |
|
|
|
|
— |
|
|
|
— |
|
|
|
|
|
— |
|
|
anything |
denied |
terminal |
Four rows carry more than the table shows.
PLANNED or DISPATCHING plus EVENT_STARTED leads to RUNNING.
The acknowledgement and the start event travel on different queues without a shared order.
The ACS can start measuring and report it before this service applies the acknowledgement.
A denial would strand a live run in DISPATCHING until the watchdog closed it.
EVENT_STOPPED splits on the in-flight count of the ACS.
A positive count or an absent count keeps the run in STOPPING, because those devices still produce measurements.
Only a count of zero closes the run at once.
An absent count counts as positive on purpose: a wait costs time, and an early close costs measurements.
STOPPING plus EVENT_FINISHED leads to STOPPED, not to FINISHED.
The decision of the operator is what the run history must show.
STOPPED, FINISHED and FAILED are terminal.
No late event and no second watchdog tick leaves them.
A stop of a PLANNED run diverges from the table on purpose.
Such a run has no command on the ACS, and its command_seq is still the placeholder 0.
A STOP for it would consume a sequence number and name an unknown run.
The service closes the row locally as STOPPED with no command.
The endpoint then answers commandPublished: false.
See POST /FCC/stop.
Scheduled work
Five pollers drive the scheduled work of the service: the outbox dispatcher, the acknowledgement timeout poller, two due-work passes and two closing passes. See The five pollers for every cadence.
Each poller claims its due rows and holds the claim until it commits.
Two instances therefore never dispatch the same campaign, and no distributed lock is needed.
Poller state lives in the business row, for example fcc_test.state, fcc_activation.window_end_at and fcc_acs_outbox.next_attempt_at.
After a crash there is no separate job store to reconcile.
See ftfcc schema for the index behind each claim.
Each pass is its own transaction. A backlog of due campaigns and a backlog of due reactivations are independent. A failure inside a pass applies nothing, and the next tick claims the rows again.