Class NatsBase

    • Method Detail

      • pid

        public int pid()
        get process id
        Returns:
        process id or -1 if process is not running
      • pidFile

        public Path pidFile()
        get process id file which only exists when the process is running
        Returns:
        process id file path
      • binaryFile

        public Path binaryFile()
        nats binary file which only exists after download or if its already placed there
        Returns:
        nats binary file path
      • downloadUrl

        public String downloadUrl()
        nats download url which is usually a zip file
        Returns:
        nats download url
      • url

        public String url()
        nats server URL from bind to host address
        Returns:
        nats server url
      • port

        public int port()
        Gets the port out of the configuration
        Returns:
        configured port of the server
        Throws:
        RuntimeException - when the port is not configured
      • args

        public NatsBase args​(String... args)
        Adds custom arguments to the nats start command
        Parameters:
        args - arguments
        Returns:
        self NatsBase
      • args

        public List<String> args()
        Get customArguments
        Returns:
        list of custom arguments
      • getValue

        public String getValue​(NatsStreamingConfig key)
        Gets resolved config value from key
        Parameters:
        key - config key
        Returns:
        config key value
      • getValue

        public String getValue​(NatsStreamingConfig key,
                               Supplier<String> or)
        Gets resolved config value from key
        Parameters:
        key - config key
        or - lazy loaded fallback value
        Returns:
        config key value