On Fri, May 29, 2020 at 10:27 PM Ash Berlin-Taylor <[email protected]> wrote:
>
>
> @Test
> public void confDynamicTest() {
> JsonObject x = new JsonObject();
> x.addProperty("x", 34);
> model.setConf(x);
> Assert.assertEquals(new JSON().serialize(model),
> "{\"external_trigger\":true,\"conf\":{\"x\":34}}");
>
> JsonObject a = new JsonObject();
> JsonArray aa = new JsonArray();
> aa.add(1);
> aa.add(2);
> aa.add(3);
> a.add("a", aa);
> model.setConf(a);
> Assert.assertEquals(new JSON().serialize(model),
> "{\"external_trigger\":true,\"conf\":{\"a\":[1,2,3]}}");
>
> JsonObject zw = new JsonObject();
> JsonArray z = new JsonArray();
> z.add(1);
> z.add(2);
> zw.add("Z", z);
> zw.addProperty("W", "a");
> model.setConf(zw);
> Assert.assertEquals(new JSON().serialize(model),
> "{\"external_trigger\":true,\"conf\":{\"Z\":[1,2],\"W\":\"a\"}}");
> }
>
>
Again I repeat the question: How do you do that without recompiling the
client in java? T
Take my example of "CLI". where you want to trigger different dag with
different parameters to pass.
Please correct me if I am wrong, but your solution means that every time
you have a new DAG you neeed to implement the logic in your Java client for
this specific DAG.
I imagine as a user I would like to run
java -jar client.jar tirgger_dag dag_id ="dag_id"
exection_date="2020-10-01" conf="{a: [1, 2, 3]"
java -jar client.jar tirgger_dag dag_id ="dag_id"
exection_date="2020-10-01" conf="{w:a}"
and when a new dag appears I would like to run it with "conf ="xy": z}
Remember that - unlike with python scripts - people who use java clientx
do not recompile them every time they run them, nor weekly. They usually
have some pre-compiled, ready to run .jar files to run their code.
How do you want to do that?
J.
--
Jarek Potiuk
Polidea <https://www.polidea.com/> | Principal Software Engineer
M: +48 660 796 129 <+48660796129>
[image: Polidea] <https://www.polidea.com/>