# Pipes

## Pipes

마이크로 서비스 **파이프**와 [일반 파이프](https://app.gitbook.com/pipes) 사이에는 차이가 없습니다. 알아야할 유일한 것은 `HttpException`을 발생시키는 대신 `RpcException`을 사용해야 한다는 것입니다.

> info **힌트** `RpcException` 클래스는`@nestjs/microservices` 패키지에서 노출됩니다.

## Binding pipes

다음은 수동으로 인스턴스화된 메소드 범위 파이프를 사용하는 예입니다 (클래스 범위도 작동 함).

```typescript
@@filename()
@UsePipes(new ValidationPipe())
@MessagePattern({ cmd: 'sum' })
accumulate(data: number[]): number {
  return (data || []).reduce((a, b) => a + b);
}

```
