以 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}