public class MinionGrpcClient extends AbstractMessageDispatcherFactory<String>
RPC : RPC runs in bi-directional streaming mode. Minion gets each request and it handles each request in a separate thread. Once the request is executed, the response sender call is synchronized as writing to observer is not thread-safe. Minion also sends it's headers (SystemId/location) to OpenNMS whenever the stub is initialized.
Sink: Sink runs in uni-directional streaming mode. If the sink module is async and OpenNMS Server is not active, the messages are buffered and blocked till minion is able to connect to OpenNMS.
Constructor and Description |
---|
MinionGrpcClient(MinionIdentity identity,
org.osgi.service.cm.ConfigurationAdmin configAdmin) |
Modifier and Type | Method and Description |
---|---|
void |
bind(RpcModule module) |
<S extends Message,T extends Message> |
dispatch(SinkModule<S,T> module,
String metadata,
T message) |
org.osgi.framework.BundleContext |
getBundleContext() |
String |
getMetricDomain() |
com.codahale.metrics.MetricRegistry |
getMetrics() |
io.opentracing.Tracer |
getTracer() |
TracerRegistry |
getTracerRegistry() |
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext) |
void |
setMetrics(com.codahale.metrics.MetricRegistry metrics) |
void |
setTracerRegistry(TracerRegistry tracerRegistry) |
void |
shutdown() |
void |
start() |
void |
unbind(RpcModule module) |
createAsyncDispatcher, createSyncDispatcher, createSyncDispatcher, getModuleMetadata, onDestroy, onInit
public MinionGrpcClient(MinionIdentity identity, org.osgi.service.cm.ConfigurationAdmin configAdmin)
public void start() throws IOException
IOException
public void shutdown()
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
public String getMetricDomain()
getMetricDomain
in class AbstractMessageDispatcherFactory<String>
public org.osgi.framework.BundleContext getBundleContext()
getBundleContext
in class AbstractMessageDispatcherFactory<String>
public io.opentracing.Tracer getTracer()
getTracer
in class AbstractMessageDispatcherFactory<String>
public com.codahale.metrics.MetricRegistry getMetrics()
getMetrics
in class AbstractMessageDispatcherFactory<String>
public void setMetrics(com.codahale.metrics.MetricRegistry metrics)
public TracerRegistry getTracerRegistry()
public void setTracerRegistry(TracerRegistry tracerRegistry)
public <S extends Message,T extends Message> void dispatch(SinkModule<S,T> module, String metadata, T message)
dispatch
in class AbstractMessageDispatcherFactory<String>
Copyright © 2020. All rights reserved.