以 evt-imdb_produce_service-to_refresh--imdb_consumer_service.refresh
佇列舉例
投遞訊息
dispatch(
'imdb_produce_service',
'to_refresh',
message.json(ensure_ascii=False)
)
消費訊息
class ImdbRefreshService:
name = 'imdb_consumer_service'
@event_handler(
source_service='imdb_produce_service',
event_type='to_refresh',
requeue_on_error=True)
def refresh(self, payload: str) -> None:
message = Message.parse_raw(payload)
所以,nameko 佇列的命名規則是: evt-{source_service_name}-{event_type}--{dst_service_name}.{dst_class_func_name}