0

I've been trying to validate if our server has started in Wildfly using the jboss-cli.bat

This is the command i'm using:

/host=slave-1/server-config=REST-server-one:read-resource(include-runtime=true)

and this is what i'm getting from the command

{
    "outcome" => "success",
    "result" => {
        "auto-start" => true,
        "cpu-affinity" => undefined,
        "group" => "wildfly-server-group",
        "name" => "wildfly-server",
        "priority" => undefined,
        "socket-binding-default-interface" => undefined,
        "socket-binding-group" => undefined,
        "socket-binding-port-offset" => 0,
        "status" => "STARTED",
        "update-auto-start-with-server-status" => false,
        "interface" => undefined,
        "jvm" => undefined,
        "path" => undefined,
        "ssl" => undefined,
        "system-property" => undefined
}

Is there a command that will return the value of the status in that response?

aeycee
  • 167
  • 2
  • 2
  • 14

2 Answers2

1

You should be able to use the read-attribute operation.

/host=slave-1/server-config=REST-server-one:read-attribute(name=status)
James R. Perkins
  • 16,800
  • 44
  • 60
0

I end up using this

BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));

            String line = reader.readLine();
            while (line != null) {
                String[] value  = line.split("=>");
                if(value.length > 1){
                    if(value[0].contains("\"status\"")){
                        System.out.println(value[1]);
                    }
                }
                line = reader.readLine();
            }

If anyone can suggest a better method would be greatly appreciated.

aeycee
  • 167
  • 2
  • 2
  • 14