error saga-without-role
Сага без роли, которая её выполняет.
What it means#
A saga runs on the nodes of roles with runs sagas, and its log needs a role with journal. A cluster that declares a saga must have both.
Example#
service Ledger {
@public @idempotent rpc charge(id: u64) -> u64
}
impl Ledger {
rpc charge(id) { id }
}
saga order(x: u64) -> u64 { // <- saga-without-role
Ledger.charge(x)
}
cluster demo { role api { serves Ledger } }error
saga-without-role
How to fix#
Add role saga { runs sagas } and a journal role.
service Ledger {
@public @idempotent rpc charge(id: u64) -> u64
}
impl Ledger {
rpc charge(id) { id }
}
saga order(x: u64) -> u64 {
Ledger.charge(x)
}
cluster demo {
role api { serves Ledger }
role saga { runs sagas; journal }
}