Skip to content

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

@dpr-dev

Description

@dpr-dev
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions