Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在apachecamel中修改springbootbean_Java_Spring Boot_Graphql_Apache Camel - Fatal编程技术网

Java 在apachecamel中修改springbootbean

Java 在apachecamel中修改springbootbean,java,spring-boot,graphql,apache-camel,Java,Spring Boot,Graphql,Apache Camel,我试图通过ApacheCammel GraphQL组件创建GraphQL变体。我知道SpringBoot的一些基本知识,但是我还没有对它进行过太多的研究 下面的代码一切正常。但是,当我尝试更改bean变量(JsonObject)时,我发现我无法真正以编程方式更改它们。你能给我一些建议让它起作用吗 @Bean public JsonObject addProductMutationVariables() { JsonObject variables = new JsonObject();

我试图通过ApacheCammel GraphQL组件创建GraphQL变体。我知道SpringBoot的一些基本知识,但是我还没有对它进行过太多的研究

下面的代码一切正常。但是,当我尝试更改bean变量(JsonObject)时,我发现我无法真正以编程方式更改它们。你能给我一些建议让它起作用吗

@Bean
public JsonObject addProductMutationVariables() {
    JsonObject variables = new JsonObject();
    variables.put("sku", "sku001");
    variables.put("title", "Product 001");
    return variables;
}
rest().get("/api/demo")
    .to("direct:hello");

from("direct:hello")
    .process(new MyProcessor())            
    .to("graphql://https://api-url/graphql?queryFile=productcreate.graphql&variables=#addProductMutationVariables&accessToken=Token");