44 Commits

Author SHA1 Message Date
spencergibb
6c41efc21e Migrates to new AutoConfiguration.imports
Fixes gh-301
2022-09-21 17:30:49 -04:00
Olga Maciaszek-Sharma
a0cb69742d Add runtime hints. Removed unused dependency. 2022-08-05 16:25:03 +02:00
spencergibb
8a576fafe9 reorder javadoc tags 2022-01-26 16:21:20 -05:00
spencergibb
583709f132 Fixes for ZookeeperConfigServerBootstrapper inconsistencies.
Do not create a property source if CuratorFramework is null in ZookeeperConfigDataLoader.

Do not register CuratorFramework twice in CuratorFactory

Fixes gh-290
2021-12-10 12:50:50 -05:00
spencergibb
5d849a173c Don't register CuratorFramework bean in config data when not needed.
If config client and zookeeper discovery are on the classpath, only register beans in context if discovery enabled is true.

Fixes gh-280
2021-05-17 15:58:11 -04:00
spencergibb
b8cc08f74c Updates to use updated ConfigData apis 2020-10-18 11:54:27 -04:00
spencergibb
9abe83b8d0 Merge branch '2.2.x' 2020-09-24 10:58:05 -04:00
spencergibb
2703a24402 extracts prefix constant 2020-09-24 09:55:30 -04:00
spencergibb
094c309dbf Updates tests to use a consistent ZookeeperTestingServer
This speeds up testing.
2020-09-24 09:41:46 -04:00
spencergibb
e3b2eeabf8 Moves CuratorFramework bootstrap registration to CuratorFactory 2020-09-22 12:24:52 -04:00
spencergibb
beb4873984 Updates to use new Bootstrap apis in boot.
Creates a ZookeeperBootstrapper for users to customize Zookeeper.

Moves CuratorFramework create to CuratorFactory that is used in auto configuration and ConfigData
2020-09-18 13:29:53 -04:00
Spencer Gibb
abed38689e Support for new Spring Boot ConfigData framework. (#265) 2020-09-08 15:38:03 -04:00
spencergibb
df16943bcd Adds is*Enabled around log statements 2020-08-14 10:56:00 -04:00
spencergibb
c0b36de3cf Removes use of javax.validation 2020-05-28 16:16:36 -04:00
Spencer Gibb
f8a1764d05 Updates getIfAvailable() to ifAvailable() 2020-04-20 15:52:02 -04:00
Bernardo Gomez Palacio
163a0af006 Session & connection timeout properties; Adding CuratorFrameworkCustomizer
We currently don't have a simple mechanism to configure CuratorFramework's session and connection timeout.
Since Curator 3.x users can affect how Curator handles re-connection, since the meaning of LOST was changed.
In 3.x when the "Disconnected" is received Curator starts an internal timer.
When the timer passes the negotiated session timeout Curator calls `getTestable().injectSessionExpiration()`
and posts a LOST state change.

In Curator 4.x the session timeout defaults to 60 seconds and the connection timeout to 15 seconds.
Ref:
```
private static final int DEFAULT_SESSION_TIMEOUT_MS = Integer.getInteger("curator-default-session-timeout", 60 * 1000);
private static final int DEFAULT_CONNECTION_TIMEOUT_MS = Integer.getInteger("curator-default-connection-timeout", 15 * 1000);
```

Proposed Solution
=================

Offer a mechanism to configure the session and connection timeout and
establish a mechanism to be able to customize the `CuratorFramework` for
future-proving.

We could avoid having two more properties, the session and connection timeouts, as part of `ZookeeperProperties` and
let users define them on their `CuratorFrameworkCustomizer`. The current rational is that consolidating this two
configuration properties as part of the `spring.cloud.zookeeper` configuration namespace is valuable and simplifies
their usage.

Additional Context
==================

> Curator will set the LOST state when it believes that the ZooKeeper session has expired.
> ZooKeeper connections have a session. When the session expires, clients must take appropriate action.
> In Curator, this is complicated by the fact that Curator internally manages the ZooKeeper connection.
> Curator will set the LOST state when any of the following occurs:
> a) ZooKeeper returns a Watcher.Event.KeeperState.Expired or KeeperException.Code.SESSIONEXPIRED;
> b) Curator closes the internally managed ZooKeeper instance;
> c) The session timeout elapses during a network partition. It is possible to get a RECONNECTED state after
> this but you should still consider any locks, etc. as dirty/unstable.
Ref. [Curator Errors](https://curator.apache.org/errors.html)

Warning: Curator 4.0.1 is affected by [CURATOR-460: Timed tolerance for connection suspended leads to simultaneous leaders](https://issues.apache.org/jira/browse/CURATOR-460). This was addressed in `4.1.0`.

Additional references:
=====================
* [TN14: ZooKeeper's Session Handling](https://cwiki.apache.org/confluence/display/CURATOR/TN14)
* [CURATOR-460](https://issues.apache.org/jira/browse/CURATOR-460)
* [Curator Errors](https://curator.apache.org/errors.html)

fixes gh-244
2020-04-20 15:51:06 -04:00
Bernardo Gomez Palacio
7b9463a6d5 Adds the option to define a TraceDriver for the CuratorFramework
This commits adds the option to define a Curator `TracerDriver`, which
if available, will be used in the CuratorZookeeperClient wrapped inside the
CuratorFramework.

Fixes gh-241
Fixes gh-242
2020-03-16 15:33:01 -04:00
Marcin Grzejszczak
987a53a850 Update auto-configuration to use @Configuration(proxyBeanMethods=false); fixes gh-236 2019-11-13 14:08:46 +01:00
Spring Operator
a9ae6f734b URL Cleanup (#203)
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 108 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 15:01:27 -04:00
Spencer Gibb
3fa477c7d3 Updates to current formatting standards 2019-02-07 13:46:37 -05:00
Tom Gianos
df6d748cd3 Fix Zookeeper health endpoint bean registration (#185)
There was a bug in the evaluation order for ZookeeperHealthIndicator bean where its conditions for creation,
particularly whether there was a CuratorFramework bean, were evaluated too early causing it to always fail.

This commit moves the inner ZookeeperAutoConfiguration.ZookeeperHealthConfig class into its own public class
ZookeeperHealthAutoConfiguration and makes sure its configured as auto configuration after ZookeeperAutoConfiguration.

This seems to resolve the order problem in testing.

Unit tests added for conditions on ZookeeperHealthIndicator bean.

Minor change to ZookeeperHealthIndicator to only call curator getState method once rather than twice.
2018-12-07 14:00:08 -05:00
Spencer Gibb
0d059866ce Updates for Finchley and boot 2.0 2017-09-27 14:03:52 -04:00
Denis Stepanov
d1a5880910 Fix ZookeeperProperties warning (#120)
Fixes gh-117
2017-03-29 16:53:28 -04:00
Marcin Grzejszczak
664c47a594 Added support for disabling Zookeeper / Discovery
fixes #105
2017-01-12 14:09:36 +01:00
konrad.dobrzynski
26aea48b9d Repaired overriding of connection string from EnsembleProvider
fixes gh-86
2016-06-20 10:51:12 -06:00
Marcin Grzejszczak
834ab8034c Migrated core to Java 2016-04-29 18:53:00 +02:00
Marcin Grzejszczak
a7d3d4f6b4 Migrated a couple of classes from groovy to java 2016-04-27 15:14:52 +02:00
Dave Syer
b3abb02e14 Remove featureless ZookeeperEndpoint 2016-04-26 18:47:38 +01:00
Dave Syer
bb0ba6b9aa Add enabled flag for zookeeper health indicator
Fixes gh-76
2016-04-26 09:12:53 +01:00
Marcin Grzejszczak
119db82924 Fixed wrong @EnableConfigurationProperties setting 2016-04-21 11:05:36 +02:00
Marcin Grzejszczak
6532753691 Added javadocs for core 2016-03-25 11:58:05 +01:00
Marcin Grzejszczak
99ca466758 Remove Lombok
fixes #62
2016-03-10 11:35:55 +01:00
Marcin Grzejszczak
54acbae918 Added checkstyle 2016-03-09 15:34:35 +01:00
Marcin Grzejszczak
220cab870b [#54] Created the list of statuses for nested dependencies. Fixes #54 2015-12-15 14:13:16 +01:00
Spencer Gibb
2de7b439a5 Wait for curator client to connect to zookeeper.
Make cached property source the default.

fixes gh-39
2015-10-06 17:12:00 -06:00
Spencer Gibb
aaff1ce2f6 Updated/added copyright 2015-08-10 10:23:01 -06:00
Spencer Gibb
235ccb7ad7 two more spring.cloud prefixes 2015-07-30 11:32:50 -06:00
Spencer Gibb
64693b44b2 add support for optional EnsembleProvider
fixes gh-18
2015-07-29 18:10:26 -06:00
Spencer Gibb
d122e3bffd polish 2015-07-29 18:03:34 -06:00
Spencer Gibb
68005c3beb Spring Cloud Zookeeper starters
fixes gh-12
2015-07-29 17:07:42 -06:00
Spencer Gibb
7de227b9e8 Use spring.cloud.zookeeper config namespace
rather than just 'zookeeper'.

fixes gh-17
2015-07-29 16:16:52 -06:00
Marcin Grzejszczak
3e48eb298b WIP on further 4financeIT migration - properties required for gradual rollout 2015-07-29 00:16:00 +02:00
Marcin Grzejszczak
a33d9ae644 Zookeeper registration and Zookeeper dependency setting in properties by 4financeIT
Below you can find all people that made the initial solution come to be

Kamil Szymański <kamil.szymanski@4finance.com>
Karol Kalinski <karol.kalinski@4finance.com>
Konrad Dobrzynski <konrad.dobrzynski@4finance.com>
Marcin Grzejszczak <marcin.grzejszczak@4finance.com>
Marcin Zajaczkowski <marcin.zajaczkowski@4finance.com>
Matus Hennel <matus.hennel@4finance.com>
Michal Chmielarz <michal.chmielarz@4finance.com>
Jakub Pilimon <jakub.pilimon@4finance.com>
Tomasz Nurkiewicz <tomasz.nurkiewicz@4finance.com>
Urszula Choromanska <urszula.choromanska@4finance.com>
Jakub Nabrdalik <jakub.nabrdalik@4finance.com>
2015-05-28 19:56:39 +02:00
Spencer Gibb
87357d2732 initial commit 2015-01-28 14:35:15 -07:00