Commit Graph

1179 Commits

Author SHA1 Message Date
Asim Aslam
378af01f77 update readme 2018-04-08 15:20:10 +01:00
Asim Aslam
c317547e4d bump travis 2018-04-08 12:53:57 +01:00
Asim Aslam
e55437698b misc moved to util 2018-04-08 12:37:45 +01:00
Asim Aslam
e365cad930
Merge pull request #245 from micro/register
add flags for register ttl and interval
2018-04-06 14:14:11 +01:00
Asim Aslam
56735b4427 add flags for register ttl and interval 2018-04-06 14:03:39 +01:00
Asim Aslam
73e22eb5b1 gofmt 2018-04-06 14:03:00 +01:00
Asim Aslam
c04b974311 nitpick the readme 2018-04-05 13:50:10 +01:00
Asim Aslam
75be57d6e4 syntax highlight code 2018-03-22 17:32:16 +00:00
Asim Aslam
270e9118c4 nitpick 2018-03-22 16:46:34 +00:00
Asim Aslam
5d3d61855c nitpick 2018-03-22 16:44:40 +00:00
Asim Aslam
7e0ee9ec08 include pubsub in the readme 2018-03-22 16:43:57 +00:00
Asim Aslam
2ae4214215
Merge pull request #238 from myabuyllc/registry-tcp-check
Add option to enable TCP check with Consul registry
2018-03-21 19:07:56 +00:00
Asim Aslam
edaa0a0719
Merge pull request #240 from Leon2012/master
fix bug #239
2018-03-21 18:54:52 +00:00
Shulhan
44b934d458 registry: rename context key "consul_register_tcp_check" to "consul_tcp_check" 2018-03-21 21:57:04 +07:00
Shulhan
65a90f5a21 registry.Register: use local variable to get context value 2018-03-21 18:18:48 +07:00
Shulhan
1eb4398b6c registry/consul: rename "RegisterTCPCheck" to "TCPCheck" 2018-03-21 18:17:56 +07:00
leon.peng
9b99d50396 fix bug #239 2018-03-21 03:17:38 +00:00
Shulhan
68ab671bd0 Use registry.options.Context to set Consul TCP check option 2018-03-19 20:34:56 +07:00
Shulhan
f4cdfaf27f Fix TCP address and port on service check registration 2018-03-19 20:34:12 +07:00
Asim Aslam
d486125d07 update readme 2018-03-19 10:21:46 +00:00
Shulhan
1599d717af Add option to enable TCP check with Consul registry
One disadvantage of using TTL based health check is the high network
traffic between Consul agent (either between servers, or between server
and client).

In order for the services considered alive by Consul, microservices must
send an update TTL to Consul every n seconds (currently 30 seconds).

Here is the explanation about TTL check from Consul documentation [1]

    Time to Live (TTL) - These checks retain their last known state for a
    given TTL. The state of the check must be updated periodically over
    the HTTP interface. If an external system fails to update the status
    within a given TTL, the check is set to the failed state. This
    mechanism, conceptually similar to a dead man's switch, relies on the
    application to directly report its health. For example, a healthy app
    can periodically PUT a status update to the HTTP endpoint; if the app
    fails, the TTL will expire and the health check enters a critical
    state. The endpoints used to update health information for a given
    check are the pass endpoint and the fail endpoint. TTL checks also
    persist their last known status to disk. This allows the Consul agent
    to restore the last known status of the check across restarts.
    Persisted check status is valid through the end of the TTL from the
    time of the last check.


Hint:

    TTL checks also persist their last known status to disk. This allows
    the Consul agent to restore the last known status of the check
    across restarts.

When microservices update the TTL, Consul will write to disk. Writing to
disk means all other slaves need to replicate it, which means master need
to inform other standby Consul to pull the new catalog. Hence, the
increased traffic.

More information about this issue can be viewed at Consul mailing list [2].

[1] https://www.consul.io/docs/agent/checks.html
[2] https://groups.google.com/forum/#!topic/consul-tool/84h7qmCCpjg
2018-03-14 19:40:59 +07:00
Asim Aslam
a941a4772b parallel test causes deadlock 2018-03-13 18:50:58 +00:00
Asim Aslam
dca078f30b
Merge pull request #235 from shuLhan/dev-shulhan
Fix warnings from linter output
2018-03-13 18:25:37 +00:00
Shulhan
cbbf9f7e3b [test] service.TestService: run subtest in parallel
Reason: the t.Fatalf and t.Fatal must be invoked by test routine, not by
other routine, or the the test will not stopped [1].

[1] megacheck SA2002
2018-03-13 18:12:42 +07:00
Shulhan
a54dee31de [lint] service.Init: ignore error by assigning it to blank identifier 2018-03-13 17:51:33 +07:00
Shulhan
1bd541b69e service.Run: replace signal SIGKILL with SIGQUIT
According to "os/signal" documentation [1] and libc manual [2], SIGKILL
may not be caught by a program.

[1] https://godoc.org/os/signal
[2] https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html
2018-03-13 17:45:34 +07:00
Shulhan
e769802939 service.Run: simplify return statement 2018-03-13 17:40:13 +07:00
Asim Aslam
a3741f8a11 strip namespace from readme 2018-03-09 19:11:42 +00:00
Asim Aslam
6246fa2bcb
Merge pull request #233 from micro/context
switch to stdlib context
2018-03-04 09:15:25 +00:00
Asim Aslam
c9b40cb33b switch to stdlib context 2018-03-03 11:53:52 +00:00
Asim Aslam
982e6068cf support services without version 2018-03-01 17:35:13 +00:00
Asim Aslam
e8b050ffd5 update travis 2018-03-01 10:07:48 +00:00
Asim Aslam
13f8e4fef7 nitpick 2018-02-28 15:40:41 +00:00
Asim Aslam
1fe528c411 update readme 2018-02-28 15:38:50 +00:00
Asim Aslam
d0d9582b81
Merge pull request #206 from darren-west/master
Added Options() to registry interface
2018-02-19 20:52:28 +00:00
Asim Aslam
42bdca63da
Merge pull request #230 from micro/watch
Add watch options
2018-02-19 20:29:17 +00:00
Asim Aslam
02260dcaa3 Add watch options 2018-02-19 17:12:37 +00:00
Asim Aslam
eb7788ce25
Merge pull request #229 from tudurom/add_conflict_error
errors: Added 409 Conflict helper function
2018-02-13 08:33:22 +00:00
Tudor Roman
3b6f38a45c
errors: Added 409 Conflict helper function 2018-02-11 15:51:33 +02:00
Asim Aslam
94ea766c9e syntax highlight 2018-02-01 13:54:37 +00:00
Asim Aslam
ff9ad875af update readme 2018-01-30 16:18:11 +00:00
Asim Aslam
45420d8413
Merge pull request #224 from dh1tw/rpc-server-subscribe-deadlock
fix possible deadlock since code can return without unlocking the Mutex
2018-01-02 10:22:13 +00:00
Tobias Wellnitz, DH1TW
0dcea05fb8 fix possible deadlock since code can return without unlocking the Mutex 2018-01-01 19:57:13 +01:00
Asim Aslam
b0b0338128 add option to set selector 2017-12-20 21:43:24 +00:00
Asim Aslam
11d75dae1b remove version from example 2017-11-30 12:28:20 +00:00
Asim Aslam
fc0bbcd339 change the blurb 2017-11-30 09:16:54 +00:00
Asim Aslam
c82dadfa55
Merge pull request #221 from gaxxx/master
add https support for consul
2017-11-28 07:11:48 +00:00
Siyun Wu
7c8d6087de add https support for consul
using enviroment variables

for example:
export CONSUL_HTTP_SSL=1
export CONSUL_HTTP_ADDR="https://example.com"
export CONSUL_CLIENT_CERT="/Users/foo/.ssh/consul/consul.cert"
export CONSUL_CLIENT_KEY="/Users/foo/.ssh/consul/consul.key"
export CONSUL_CACERT="/Users/foo/.ssh/consul/ca.cert"
2017-11-20 15:34:52 +08:00
Asim Aslam
1f03681d82 set test to use localhost 2017-11-09 14:21:26 +00:00
Asim Aslam
1c1d46e1ac Add some test logging 2017-11-09 14:16:35 +00:00