Communication
Two channels only: synchronous Feign for computation and side effects, RabbitMQ for deferred work and event fanout. No SOA ever calls glacez-soa-webservice — it is a leaf for the whole platform.
Feign edges (verified from each service's config)
| Caller | Calls |
|---|---|
glacez-soa-webservice |
findata, core, worker, portfolio, agent |
glacez-soa-core |
findata, portfolio |
glacez-soa-worker |
findata, core |
glacez-soa-agent |
findata, portfolio |
glacez-soa-portfolio |
findata |
glacez-soa-simulator |
findata |
glacez-soa-findata |
– (leaf) |
Edges are declared per caller in application.yaml:
glacez:
soa:
findata:
url: http://glacez-soa-findata/v2
findata is the only service whose root carries a version segment (/v2) — every other client URL is the bare service root.
How a Feign call is wired
- The callee ships an
-apiartifact (e.g.glacez-soa-core-api) containing the Feign interfaces and DTOs, released with the service. - The caller depends on that artifact and its
implmodule scans the interfaces (@EnableFeignClients). - The URL comes from the caller's own config, never from the artifact.
Traps that cost real debugging time:
- A Feign package not listed in
@EnableFeignClientsfails silently — no bean, no error at startup, a missing call at runtime. apiartifact version skew: a caller built against an older-apidoes not see new members. Install the upstreamapilocally before building the downstream module, or the build succeeds against a stale jar.- A controller that returns
Stringwithproduces = application/jsonwrites the raw body (delisted=24): Spring'sStringHttpMessageConverterwins over Jackson, so the content type lies and a Feign consumer decoding aStringthrowsUnrecognized token …after the side effect already happened — a failure reported for a success. A maintenance endpoint returnsvoidand puts its count in the service log. - Never declare a second Feign interface for an endpoint that already exists in the callee's
-apiartifact. Duplicated contracts are how the two sides drift. *-apiartifacts must stay self-contained: noglacez-lib-*infra types in a public API DTO.
Locking, retries and circuit breaking are not configured per client — a Feign failure surfaces as an exception mapped by the caller's own error handler. Do not assume a retry policy exists.
The contract shape: model objects, not mirror DTOs
An SOA↔SOA Feign end speaks the shared glacez-lib-model types directly — Ohlcv, Currency, a model enum — as a parameter or a body. The two ends pin the same lib and ship in the same wave, so a mirror request entity inside *-api buys no independence; it only makes the one endpoint that has it incoherent with its siblings, and the owning service already reads just the fields it wants from the body.
The mirror boundary sits one layer out: webservice → webapp is where DTOs live (OhlcvDTO, the *DTO package in api-v1), because that is the only edge where a version skew between the server and a running client actually exists.
*-api depends on glacez-lib-model through the service's parent POM: the contracts name model types, so the dependency is the contract. Nothing else from the lib is part of it — an *-api that carries a glacez-lib-* artifact its contracts never name is a pom placement problem, not a contract, and it reaches every consumer of the published jar. The project rule is in Glacez/AGENTS.md § Cross-Service Rules.
MQ topology
Two exchanges, both glacez.*:
| Exchange | Kind | Queues |
|---|---|---|
glacez.direct |
job dispatch | glacez.trading.queue, glacez.records.queue, glacez.emails.queue, glacez.simulations.queue |
glacez.events.fanout |
state-change events | glacez.events.push.queue (+ per-consumer fanout queues) |
Producers and consumers, as deployed:
| Queue | Published by | Consumed by |
|---|---|---|
glacez.trading.queue |
webservice, core | worker |
glacez.records.queue |
webservice, core | worker |
glacez.emails.queue |
webservice, core | worker |
glacez.simulations.queue |
webservice | simulator |
glacez.events.push.queue |
webservice (from fanout) | webservice push + UI pods |
queue-durable: true in every environment except dev, where queues are declared non-durable for fast iteration cycles.
Failure semantics — read before "fixing" a retry
A job whose handler throws is acked, not requeued: the platform logs the failure and the state stays where it was. There is no dead-letter queue and no redelivery. A trading job that failed is not retried by RabbitMQ — it is retried by the next synchronization pass or by a human.
So: a message being consumed proves nothing about the outcome, and adding requeue or an nack to "make it more reliable" changes the platform's failure model. If a job must be durable, the handler has to make its own state explicit (a document, an event, a status field) before it returns.
Event path to the UI
- A service changes state and publishes on
glacez.events.fanout. webservicere-publishes the payload ontoglacez.events.push.queue.- UI pods consume it and broadcast to every open session, so all tabs converge without polling.
An event is a notification, never the source of truth: a client that misses one must still converge on the next page load, from the database.
Related
- Data ownership — when a lookup should not be a Feign call at all
- System overview — request path end to end