Java 在apachecamel中修改springbootbean
我试图通过ApacheCammel GraphQL组件创建GraphQL变体。我知道SpringBoot的一些基本知识,但是我还没有对它进行过太多的研究 下面的代码一切正常。但是,当我尝试更改bean变量(JsonObject)时,我发现我无法真正以编程方式更改它们。你能给我一些建议让它起作用吗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();
@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");