|
4 | 4 | import com.featureprobe.sdk.server.FPDetail; |
5 | 5 | import com.featureprobe.sdk.server.FPUser; |
6 | 6 | import com.featureprobe.sdk.server.FeatureProbe; |
| 7 | + |
| 8 | +import java.net.MalformedURLException; |
| 9 | +import java.net.URL; |
7 | 10 | import java.time.Duration; |
8 | 11 | import org.slf4j.LoggerFactory; |
9 | 12 | import ch.qos.logback.classic.Level; |
10 | 13 | import ch.qos.logback.classic.Logger; |
11 | 14 |
|
12 | 15 | public class FeatureProbeDemo { |
13 | 16 |
|
14 | | - // FeatureProbe server URL |
15 | | - private static final String FEATURE_PROBE_SERVER_URL = "http://localhost:4007"; |
| 17 | + // FeatureProbe server URL for local docker |
| 18 | + // private static final String FEATURE_PROBE_SERVER_URL = "http://localhost:4007"; |
| 19 | + |
| 20 | + // FeatureProbe server URL for featureprobe.io |
| 21 | + private static final String FEATURE_PROBE_IO_EVENT_URL = "https://featureprobe.io/api/server/events"; |
| 22 | + private static final String FEATURE_PROBE_IO_synchronizer_URL = "https://featureprobe.io/api/server/toggles"; |
16 | 23 |
|
17 | 24 | // Server Side SDK Key for your project and environment |
18 | 25 | public static final String SERVER_SDK_KEY = "server-8ed48815ef044428826787e9a238b9c6a479f98c"; |
19 | 26 |
|
20 | 27 | // Toggle you want to use |
21 | 28 | public static final String TOGGLE_KEY = "promotion_activity"; |
22 | 29 |
|
23 | | - public static void main(String[] args) { |
| 30 | + public static void main(String[] args) throws MalformedURLException { |
24 | 31 | Logger root = (Logger)LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); |
25 | 32 | root.setLevel(Level.WARN); |
26 | 33 |
|
27 | 34 | final FPConfig config = FPConfig.builder() |
28 | | - .remoteUri(FEATURE_PROBE_SERVER_URL) |
| 35 | +// .remoteUri(FEATURE_PROBE_SERVER_URL) |
| 36 | + .eventUrl(new URL(FEATURE_PROBE_IO_EVENT_URL)) |
| 37 | + .synchronizerUrl(new URL(FEATURE_PROBE_IO_synchronizer_URL)) |
29 | 38 | .pollingMode(Duration.ofSeconds(3)) |
30 | 39 | .useMemoryRepository() |
31 | 40 | .build(); |
|
0 commit comments