-
Notifications
You must be signed in to change notification settings - Fork 35
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
Question: How can I use two GRPC service instances? #109
Comments
May I ask you why would you do that? I'd be happy to help, but first it is unclear why you want to use the same client for different ports? |
The primary focus is on horizontal scaling and decoupling of services. Behind the ports, there are four identical Incident Services, which differ in their configurations – specifically regarding their respective data sources. Due to the significantly varying response times of each service, it is crucial that data can be independently collected and processed by each service. |
I would simply proceed with creating the services manually. The generated constructor signature for the service client is normally as follows constructor(
settings: any,
private handler: GrpcHandler
) {
// ...
} So, you can directly create one in your regular service / component. E.g.
|
Am I missing something? How are you able to get access to the GrpcHandler in a component? Do I need to inject the GRPC_INTERCEPTOR somehow? |
@ConnorLenahan please see example above. You inject clientFactory which in fact is a GrpcHandler. |
How do I need to inject the TestServiceClient(s) in my class/service?
I need the service instances, not the settings!
The text was updated successfully, but these errors were encountered: