Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dpr-dev opened this issue Jul 15, 2021 · 1 comment

Comments

@dpr-dev
Copy link

dpr-dev commented Jul 15, 2021

@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

@duongphuhiep
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants