Class MinionGrpcClient

  • All Implemented Interfaces:
    MessageDispatcherFactory

    public class MinionGrpcClient
    extends AbstractMessageDispatcherFactory<java.lang.String>
    Minion GRPC client runs both RPC/Sink together. gRPC runs in a typical web server/client mode, so gRPC client runs on each minion and gRPC server runs on OpenNMS. Minion GRPC Client tries to get two stubs/streams (RPC/Sink) from OpenNMS server when it is in active state. It also initializes RPC observer/handler to receive requests from OpenNMS.

    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 Detail

      • MinionGrpcClient

        public MinionGrpcClient​(MinionIdentity identity,
                                org.osgi.service.cm.ConfigurationAdmin configAdmin)
    • Method Detail

      • start

        public void start()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • bind

        public void bind​(RpcModule module)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • unbind

        public void unbind​(RpcModule module)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shutdown

        public void shutdown()
      • setBundleContext

        public void setBundleContext​(org.osgi.framework.BundleContext bundleContext)
      • setMetrics

        public void setMetrics​(com.codahale.metrics.MetricRegistry metrics)
      • setTracerRegistry

        public void setTracerRegistry​(TracerRegistry tracerRegistry)