@Injectable()
export class OrderDetailsService {
private readonly _client: RequestClient<
GetOrderDetailsRequest,
GetOrderDetailsResponse
>;
constructor(masstransit: MassTransitService) {
this._client = masstransit.bus.requestClient<
GetOrderDetailsRequest,
GetOrderDetailsResponse
>({
exchange: 'order-details',
requestType: new MessageType(
'GetOrderDetailsRequest',
'Contracts.Events.OrderProcessing.Requests',
),
responseType: new MessageType(
'GetOrderDetailsResponse',
'Contracts.Events.OrderProcessing.Requests',
),
});
}
public getResponse(req: GetOrderDetailsRequest) {
return this._client.getResponse(req);
}
}
if the consumer's response is moved to the error queue, the request will never be denied
if the consumer's response is moved to the error queue, the request will never be denied