danielzhe commented on code in PR #2814:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2814#discussion_r1907788658


##########
packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/rpc/DataIndexCounter.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jbpm.quarkus.devui.runtime.rpc;
+
+import io.smallrye.mutiny.Multi;
+import io.smallrye.mutiny.subscription.MultiEmitter;
+import io.vertx.core.Future;
+import io.vertx.core.Vertx;
+import io.vertx.core.json.JsonObject;
+import io.vertx.ext.web.client.WebClient;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataIndexCounter {
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(DataIndexCounter.class);
+    private final Vertx vertx;
+    private final Multi<String> multi;
+    private final WebClient dataIndexWebClient;
+
+    private String query;
+    private String field;
+    private String count = "0";
+    private MultiEmitter<? super String> emitter;
+    private long vertxTimer;
+    private String path;
+
+    public DataIndexCounter(String query, String graphField, WebClient 
dataIndexWebClient, String path) {
+        if (dataIndexWebClient == null) {
+            throw new IllegalArgumentException("dataIndexWebClient is null");
+        }
+        this.query = query;
+        this.field = graphField;
+        this.dataIndexWebClient = dataIndexWebClient;
+        this.path=path;

Review Comment:
   In fact, it is not, specially in the `jbpm-dev-ui` where the default path is 
`http://0.0.0.0/kie`. Without this code, the `DataIndexCounter` fail 
[here](https://github.com/apache/incubator-kie-tools/pull/2814/files#diff-40c015a84a4818f22053e2fe1620d27260e24625fa029982b1b289f738e4a8e9R89),
 because it calls `http://0.0.0.0/graphql` instead of 
`http://0.0.0.0/kie/graphql`.
   
   User can set a URL like `https://localhost:8080/some/long/path` for the 
setting `kogito.data-index.url`, so we need that path that is not part of the 
domain, because as you can see 
[here](https://github.com/apache/incubator-kie-tools/blob/be87d4b6bd7844cf175f74dd25ffc3bca4d19c59/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/rpc/JBPMDevuiJsonRPCService.java#L81),
 the `WebClientOptions` only contains the **host**, port and if it is ssl or 
not, not the full path (subdomain).



##########
packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/rpc/DataIndexCounter.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.jbpm.quarkus.devui.runtime.rpc;
+
+import io.smallrye.mutiny.Multi;
+import io.smallrye.mutiny.subscription.MultiEmitter;
+import io.vertx.core.Future;
+import io.vertx.core.Vertx;
+import io.vertx.core.json.JsonObject;
+import io.vertx.ext.web.client.WebClient;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataIndexCounter {
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(DataIndexCounter.class);
+    private final Vertx vertx;
+    private final Multi<String> multi;
+    private final WebClient dataIndexWebClient;
+
+    private String query;
+    private String field;
+    private String count = "0";
+    private MultiEmitter<? super String> emitter;
+    private long vertxTimer;
+    private String path;
+
+    public DataIndexCounter(String query, String graphField, WebClient 
dataIndexWebClient, String path) {
+        if (dataIndexWebClient == null) {
+            throw new IllegalArgumentException("dataIndexWebClient is null");
+        }
+        this.query = query;
+        this.field = graphField;
+        this.dataIndexWebClient = dataIndexWebClient;
+        this.path=path;

Review Comment:
   @pefernan In fact, it is not, specially in the `jbpm-dev-ui` where the 
default path is `http://0.0.0.0/kie`. Without this code, the `DataIndexCounter` 
fail 
[here](https://github.com/apache/incubator-kie-tools/pull/2814/files#diff-40c015a84a4818f22053e2fe1620d27260e24625fa029982b1b289f738e4a8e9R89),
 because it calls `http://0.0.0.0/graphql` instead of 
`http://0.0.0.0/kie/graphql`.
   
   User can set a URL like `https://localhost:8080/some/long/path` for the 
setting `kogito.data-index.url`, so we need that path that is not part of the 
domain, because as you can see 
[here](https://github.com/apache/incubator-kie-tools/blob/be87d4b6bd7844cf175f74dd25ffc3bca4d19c59/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/rpc/JBPMDevuiJsonRPCService.java#L81),
 the `WebClientOptions` only contains the **host**, port and if it is ssl or 
not, not the full path (subdomain).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to