MassTransit-JS icon indicating copy to clipboard operation
MassTransit-JS copied to clipboard

requestClient.getResponse hugs when error occurred in the consumer from the other service

Open dpr-dev opened this issue 4 years ago • 1 comments

@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

dpr-dev avatar Jul 15 '21 15:07 dpr-dev

+1 same question, how to capture error on the error queue?

duongphuhiep avatar Aug 03 '21 12:08 duongphuhiep