Merge pull request #36 from fourblocks2020/feat/slot-filled-no-route
fix(slot-filled): 매도 체결 이벤트 NO_ROUTE 라우팅 갭 해소 (M3)
This commit is contained in:
@@ -264,10 +264,18 @@ class Daemon:
|
||||
|
||||
# ------------------------------------------------------------ event hook
|
||||
def _make_event_emitter(self):
|
||||
def emit(event_type: str, slot) -> None:
|
||||
def emit(event_type: str, slot, routing_strategy_id: str | None = None) -> None:
|
||||
payload = slot_transition_event_payload(slot, event_type=event_type)
|
||||
# routing_strategy_id is supplied when the transition clears
|
||||
# slot.strategy_id (e.g. PENDING_SELL -> INACTIVE for slot_filled_sell).
|
||||
# Without this hint the routing key would use "_" and the message would
|
||||
# be NO_ROUTEd to the DLQ instead of reaching the strategy queue
|
||||
# (M2 REL-009 feedback / slot_filled NO_ROUTE fix).
|
||||
effective_strategy_id = (
|
||||
routing_strategy_id or getattr(slot, "strategy_id", None) or "_"
|
||||
)
|
||||
rk = topology.event_routing_key(
|
||||
event_type, slot.strategy_id or "_", slot.symbol or "_",
|
||||
event_type, effective_strategy_id, slot.symbol or "_",
|
||||
)
|
||||
try:
|
||||
self.event_publisher.publish_event(rk, payload)
|
||||
|
||||
Reference in New Issue
Block a user