public interface GrpcChannelFactory extends AutoCloseable
Channel
s for a given service name. Implementations are encouraged to utilize
connection pooling and thus close
should be called before disposing it.Modifier and Type | Method and Description |
---|---|
void |
close() |
default Channel |
createChannel(String name)
Creates a new channel for the given service name.
|
Channel |
createChannel(String name,
List<ClientInterceptor> interceptors)
Creates a new channel for the given service name.
|
default Channel createChannel(String name)
ClientInterceptor
s.
Note: The underlying implementation might reuse existing ManagedChannel
s allow connection reuse.
name
- The name of the service.Channel createChannel(String name, List<ClientInterceptor> interceptors)
ClientInterceptor
s.
Note: The underlying implementation might reuse existing ManagedChannel
s allow connection reuse.
Note: The given interceptors will be applied after the global interceptors. But the interceptors that were applied last, will be called first.
name
- The name of the service.interceptors
- A list of additional client interceptors that should be added to the channel.void close()
close
in interface AutoCloseable