Hi,
I have this Backend pool to balance Neo4j Graph Database
the regular check to the port is not enough  to know if the service is UP.

To be sure the server is Up I'm requesting something like
------
curl -X POST http://172.23.25.135:7474/db/data/ext/feed/graphdb/userFeed -H "Content-Type: application/json" -d '{"userId":8, "offset":0, "limit":1}' -v
and the response is
----
* About to connect() to 172.23.25.135 port 7474
*   Trying 172.23.25.135... connected
* Connected to 172.23.25.135 (172.23.25.135) port 7474
> POST /db/data/ext/feed/graphdb/userFeed HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: 172.23.25.135:7474
> Accept: */*
> Content-Type: application/json
> Content-Length: 35
>
> {"userId":8, "offset":0, "limit":1}HTTP/1.1 200 OK

< Content-Length: 173
< Content-Encoding: UTF-8
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< Server: Jetty(6.1.25)
{
  "data" : {
    "events" : [ {
      "id" : "50ae98a29619de682e000000",
      "userId" : 7334462,
      "targetId" : 8,
      "type" : 1
    } ]
  },
  "success" : true
Connection #0 to host 172.23.25.135 left intact
* Closing connection #0
-------------
I would like to check in the response
"userId" : 7334462

so I wrote
option httpchk POST /db/data/ext/feed/graphdb/userFeed HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 35\r\n{"userId":8, "offset":0, "limit":1}\r\n

to include the above line in the backend, but I have no clue how to combine it with
http-check expect

Anyone can  help me ?

Regards,
Owen



Reply via email to