Skip to content

Commit 59ffacb

Browse files
committed
move to tool - draft - cont.
Signed-off-by: liran2000 <[email protected]>
1 parent 8f03143 commit 59ffacb

File tree

2 files changed

+7
-48
lines changed

2 files changed

+7
-48
lines changed

providers/flagd/README.md

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -54,45 +54,6 @@ The value is updated with every (re)connection to the sync implementation.
5454
This can be used to enrich evaluations with such data.
5555
If the `in-process` mode is not used, and before the provider is ready, the `getSyncMetadata` returns an empty map.
5656

57-
#### Http Connector
58-
HttpConnector is responsible for polling data from a specified URL at regular intervals.
59-
It is leveraging Http cache mechanism with 'ETag' header, then when receiving 304 Not Modified response,
60-
reducing traffic, reducing rate limits effects and changes updates. Can be enabled via useHttpCache option.
61-
The implementation is using Java HttpClient.
62-
63-
##### Use cases and benefits
64-
* Reduce infrastructure/devops work, without additional containers needed.
65-
* Use as an additional provider for fallback / internal backup service via multi-provider.
66-
67-
##### What happens if the Http source is down when application is starting ?
68-
69-
It supports optional fail-safe initialization via cache, such that on initial fetch error following by
70-
source downtime window, initial payload is taken from cache to avoid starting with default values until
71-
the source is back up. Therefore, the cache ttl expected to be higher than the expected source
72-
down-time to recover from during initialization.
73-
74-
##### Sample flow
75-
Sample flow can use:
76-
- Github as the flags payload source.
77-
- Redis cache as a fail-safe initialization cache.
78-
79-
Sample flow of initialization during Github down-time window, showing that application can still use flags
80-
values as fetched from cache.
81-
```mermaid
82-
sequenceDiagram
83-
participant Provider
84-
participant Github
85-
participant Redis
86-
87-
break source downtime
88-
Provider->>Github: initialize
89-
Github->>Provider: failure
90-
end
91-
Provider->>Redis: fetch
92-
Redis->>Provider: last payload
93-
94-
```
95-
9657
### Offline mode (File resolver)
9758

9859
In-process resolvers can also work in an offline mode.
@@ -113,17 +74,15 @@ This mode is useful for local development, tests and offline applications.
11374
#### Custom Connector
11475

11576
You can include a custom connector as a configuration option to customize how the in-process resolver fetches flags.
116-
The custom connector must implement the [QueueSource interface](https://github.com/open-feature/java-sdk-contrib/blob/main/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/connector/QueueSource.java).
77+
The custom connector must implement the [Connector interface](https://github.com/open-feature/java-sdk-contrib/blob/main/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/connector/Connector.java).
11778

11879
```java
119-
QueueSource connector = HttpConnector.builder()
120-
.url(testUrl)
121-
.build();
80+
Connector myCustomConnector = new MyCustomConnector();
12281
FlagdOptions options =
123-
FlagdOptions.builder()
124-
.resolverType(Config.Resolver.IN_PROCESS)
125-
.customConnector(myCustomConnector)
126-
.build();
82+
FlagdOptions.builder()
83+
.resolverType(Config.Resolver.IN_PROCESS)
84+
.customConnector(myCustomConnector)
85+
.build();
12786

12887
FlagdProvider flagdProvider = new FlagdProvider(options);
12988
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.org.slf4j.simpleLogger.defaultLogLevel=debug
1+
org.slf4j.simpleLogger.defaultLogLevel=debug
22

33
io.grpc.level=trace

0 commit comments

Comments
 (0)