You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default a hybrid application will not inherit global pipes, interceptors, guards and filters configured for the main (HTTP-based) application.
41
-
To inherit these configuration properties from the main application, set the `inheritAppConfig` property in the second argument (an optional options object) of the `connectMicroservice()` call, as follow:
42
-
43
-
```typescript
44
-
const microservice =app.connectMicroservice({
45
-
transport: Transport.TCP
46
-
}, { inheritAppConfig: true });
47
-
```
48
-
49
38
For bind `@MessagePattern()` only to one transport of microservices in hybrid application with multiple microservices can use second argument which should get value from `Transport` enum
50
39
51
40
```typescript
@@ -74,3 +63,14 @@ getTCPDate(data, context) {
74
63
```
75
64
76
65
> info **Hint**`@Payload()`, `@Ctx()`, `Transport` and `NatsContext` are imported from `@nestjs/microservices`.
66
+
67
+
#### Sharing configuration
68
+
69
+
By default a hybrid application will not inherit global pipes, interceptors, guards and filters configured for the main (HTTP-based) application.
70
+
To inherit these configuration properties from the main application, set the `inheritAppConfig` property in the second argument (an optional options object) of the `connectMicroservice()` call, as follow:
0 commit comments