Lazy 微服务客户端
Sometimes you have to load initial data before you can create your @Client(). In this case, you can use ClientProxyFactory, which provides create() method.
有时候在创建@Client()
之前你需要加载原始数据。这时,你可以使用ClientProxyFactory
,它提供create()
方法。
import { ClientProxyFactory } from '@nestjs/microservices';
const client = ClientProxyFactory.create({
transport: Transport.TCP,
});