Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration values configured for a deployment ignored in function call #50

Open
mklaehn opened this issue Feb 28, 2018 · 0 comments
Open

Comments

@mklaehn
Copy link

mklaehn commented Feb 28, 2018

Having

package com.example.fn;

import com.fnproject.fn.api.FnConfiguration;
import com.fnproject.fn.api.RuntimeContext;

public class PojoFunction {

    private String greeting;

    @FnConfiguration
    public void setUp(RuntimeContext ctx) {
        greeting = ctx.getConfigurationByKey("GREETING").orElse("Hello");
    }

    public Object greet(String name) {
        if (name == null || name.isEmpty()) {
            name = "World";
        }
//        System.out.println(name);
        return new Greeting(greeting, name);
    }

    public static class Greeting {

        public final String name;
        public final String salutation;

        public Greeting(String salutation, String name) {
            this.salutation = salutation;
            this.name = name;
        }
    }
}

and deploying PojoFunction to Fn Server allows PojoFunction to be seen in a running fn-ui container.
It is then possible to add Configurations for PojoFunction by executing the Edit button for that deployment.

There's several problems with this.

  1. already configured config values are not shown
  2. configuration values added here are of no relevance to a fn call execution. i.e. the value are ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant