Skip to content

A "hello world" using aperture-java-core 2.30.0 is not working as expected #36

@jgoeres

Description

@jgoeres

Hi,

I am trying to do a "Hello world" with Aperture for a simple Java app. At first I tried to run controller and agent locally and it wouldn't work,so I gave up and signed up for the SaaS trial. I provide my endpoint and key to the ApertureSDK.builder() as it can be found in many examples (although older examples use setAgentAddress()), in particular using the sample code that is shown at .app.fluxninja.com/aperture-system/details (the only thing I left out is the setRootCertificateFile() call - I assume that since this is an official SaaS endpoint, it would have non-self signed cert from a trusted CA).

apertureSDK = ApertureSDK.builder()
    .setAddress("agents.us-central1.gcp.app.fluxninja.com:443")
    .setAPIKey("ababababababababbababa")
    .useInsecureGrpc(false)
    .build();

The call is successful. Next I create feature flow parameters:

Map<String,String> labels = new HashMap<>();
labels.put("a", "xyz");
FeatureFlowParameters params =
        FeatureFlowParameters.newBuilder("awesome-feature")
                .setExplicitLabels(labels)
                .setRampMode(false)
                .setFlowTimeout(Duration.ofMillis(1000))
                .build();

I then start a flow (I just put this into a loop with a delay between each try).

Flow flow = apertureSDK.startFlow(params);
if (flow.shouldRun()) {
    log.info("Flow accepted: "+flow.getDecision());
} else {
    log.info("Flow rejected: "+flow.getRejectionHttpStatusCode() );
}

flow.shouldRun() is always true, but the flow.getDecision()[.toString()] always yields "Unreachable", same result as I had when I ran against my local agent+controller.

When I try to end the flow

EndResponse end = flow.end();
if (end.getError()!= null) {
    log.error("Error ending flow: " + end.getError());
}

end.getError() is always not null and end.getError() reads "java.lang.IllegalStateException: Flow without check response"

I then tried

CheckResponse checkResponse = flow.checkResponse();

before the call to flow.end(), but checkResponse is null.

I guess I am missing something very basic here, any hints appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions