apache / incubator-kie-kogito-apps

Kogito Apps - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
59 stars 126 forks source link

data-index computes wrong serviceUrl #713

Closed mingfang closed 3 years ago

mingfang commented 3 years ago

https://github.com/kiegroup/kogito-apps/blob/07160792a3f5bb9c36ccf0b66c6de745d5c410ee/data-index/data-index-service/data-index-service-common/src/main/java/org/kie/kogito/index/graphql/GraphQLSchemaManager.java#L174

should use lastIndexOf(), e.g.

            return endpoint.contains("/" + context) ? endpoint.substring(0, endpoint.lastIndexOf("/" + context)) : null;

To see the problem using Kogito-travel-agency example, in travels app set kogito.service.url=http://travels.example.com. Then start a new process instance. When you query data-index service you will see the serviceUrl field as http:/ which is wrong.

cristianonicolai commented 3 years ago

@mingfang thanks for reporting it.