55import com .featureprobe .sdk .server .FPUser ;
66import com .featureprobe .sdk .server .FeatureProbe ;
77import java .io .IOException ;
8+ import java .util .concurrent .TimeUnit ;
9+
10+ import com .featureprobe .sdk .server .Loggers ;
11+ import groovy .util .logging .Slf4j ;
812import org .slf4j .LoggerFactory ;
913import ch .qos .logback .classic .Level ;
1014import ch .qos .logback .classic .Logger ;
1115
1216public class FeatureProbeDemo {
1317
18+ private static final org .slf4j .Logger logger = Loggers .MAIN ;
19+
1420 // FeatureProbe server URL for local docker
1521 private static final String FEATURE_PROBE_SERVER_URL = "http://localhost:4009/server" ; // "https://featureprobe.io/server";
1622
@@ -25,11 +31,16 @@ public static void main(String[] args) throws IOException {
2531
2632 final FPConfig config = FPConfig .builder ()
2733 .remoteUri (FEATURE_PROBE_SERVER_URL )
34+ .startWait (5L , TimeUnit .SECONDS )
2835 .build ();
2936
3037 // Init FeatureProbe, share this FeatureProbe instance in your project.
3138 final FeatureProbe fpClient = new FeatureProbe (FEATURE_PROBE_SERVER_SDK_KEY , config );
3239
40+ if (!fpClient .initialized ()) {
41+ logger .error ("SDK failed to initialize!" );
42+ }
43+
3344 // Create one user.
3445 FPUser user = new FPUser ()
3546 .with ("userId" , "00001" ); // "userId" is used in rules, should be filled in.
0 commit comments