Skip to content

Commit

Permalink
kie-kogito-examples-1915: Loan broker example updates after the migra…
Browse files Browse the repository at this point in the history
…tion to Quarkus 3.8.4 (#1916)
  • Loading branch information
wmedvede authored May 13, 2024
1 parent 85ea169 commit ef42ae6
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void configure() {
.getTypeConverterRegistry()
.addTypeConverter(CloudEvent.class, AggregationResponse.class,
cloudEventsConverter);

from("direct:aggregator")
.routeId("quotes-aggregator")
.aggregate(header(IntegrationConstants.KOGITO_FLOW_ID_HEADER), new QuotesAggregationStrategy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ org.acme.serverless.loanbroker.aggregator.replyTo=${K_SINK:http://localhost:8080
quarkus.swagger-ui.always-include=true
mp.openapi.extensions.smallrye.operationIdStrategy=METHOD

quarkus.kubernetes.name=loanbroker-aggregator
quarkus.kubernetes.deployment-target=kubernetes
quarkus.kubernetes.deploy=false
quarkus.kubernetes.image-pull-policy=IfNotPresent
quarkus.kubernetes.image-pull-policy=if-not-present

# profile to pack this example into a container, to use it execute activate the maven container profile, -Dcontainer
%container.quarkus.container-image.group=dev.local
%container.quarkus.container-image.registry=dev.local
%container.quarkus.container-image.group=${USER}
%container.quarkus.container-image.name=loanbroker-aggregator
%container.quarkus.container-image.build=true
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ add_flow_url_to_ui() {

expose_loanbroker_ui() {
echo "Exposing UI, please run 'minikube tunnel -p knative' in a separate terminal"
kubectl expose deployment serverless-workflow-loanbroker-showcase-ui --name=loanbroker-ui-external --type=LoadBalancer --port=8080 -n ${NAMESPACE}
kubectl expose deployment loanbroker-ui --name=loanbroker-ui-external --type=LoadBalancer --port=8080 -n ${NAMESPACE}
sleep 5
LOANBROKER_EXTERNAL_IP=$(kubectl get service loanbroker-ui-external -o=jsonpath --template="{.status.loadBalancer.ingress[0].ip}" -n loanbroker-example)
echo "To access the loanbroker-example UI please use this url: http://$LOANBROKER_EXTERNAL_IP:8080"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ metadata:
namespace: loanbroker-example
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "1"
autoscaling.knative.dev/maxScale: "1"
labels:
app.kubernetes.io/name: event-display
spec:
containers:
- # This corresponds to
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,41 @@
# under the License.
#

kogito.service.url=${KOGITO_SERVICE_CLUSTER_URL:http://localhost:8080}
kogito.service.url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-flow}
%dev.kogito.service.url=http://localhost:8080

kogito.messaging.as-cloudevents=true
kogito.addon.messaging.outgoing.cloudEventMode.kogito_outgoing_stream=structured

quarkus.http.cors.origins=*
quarkus.http.cors=true
quarkus.http.cors.origins=/.*/

quarkus.log.category."org.kie".level=DEBUG
quarkus.log.category."org.kogito".level=DEBUG
quarkus.log.category."org.acme".level=DEBUG
quarkus.swagger-ui.always-include=true
quarkus.http.cors=true
quarkus.rest-client.credit_bureau_yaml.url=${CREDIT_BUREAU_URL:http://localhost:8181/}
quarkus.rest-client.aggregator_yaml.url=${AGGREGATOR_URL:http://localhost:8282/}

# Use the Kogito service discovery mechanism to get the services url.
# For more information see: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/cloud/kubernetes-service-discovery.html
quarkus.rest-client.credit_bureau_yaml.url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-credit-bureau}
quarkus.rest-client.aggregator_yaml.url=${kubernetes:services.v1/loanbroker-example/loanbroker-aggregator}

%dev.quarkus.rest-client.credit_bureau_yaml.url=http://localhost:8181
%dev.quarkus.rest-client.aggregator_yaml.url=http://localhost:8282

mp.messaging.incoming.kogito_incoming_stream.path=/
mp.messaging.incoming.kogito_incoming_stream.connector=quarkus-http

quarkus.kubernetes.deploy=false
quarkus.knative.name=loanbroker-flow
quarkus.kubernetes.deployment-target=knative
quarkus.knative.image-pull-policy=IfNotPresent
# Use the Kogito service discovery mechanism to get the services url.
# For more information see: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/cloud/kubernetes-service-discovery.html
quarkus.knative.env.vars.kogito_service_cluster_url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-flow}
quarkus.knative.env.vars.credit_bureau_url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-credit-bureau}
quarkus.knative.env.vars.aggregator_url=${kubernetes:services.v1/loanbroker-example/loanbroker-aggregator}
quarkus.knative.image-pull-policy=if-not-present

quarkus.knative.min-scale=1
quarkus.knative.max-scale=1

# Kogito persistence configurations for enabling the serverless workflow persistence
%persistence.quarkus.container-image.group=dev.local
%persistence.quarkus.container-image.registry=dev.local
%persistence.quarkus.container-image.group=${USER}
%persistence.quarkus.container-image.name=loanbroker-flow
%persistence.quarkus.container-image.build=true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ quarkus.http.test-port=0

# Act as a placeholder to avoid triggering Kubernetes Service Discovery during test runs
# The actual URLs are set by the Quarkus Test Runner
quarkus.knative.env.vars.kogito_service_cluster_url=http://localhost:8080
quarkus.knative.env.vars.credit_bureau_url=http://localhost:8080
quarkus.knative.env.vars.aggregator_url=http://localhost:8080
kogito.service.url=http://localhost:${quarkus.http.port}
quarkus.rest-client.credit_bureau_yaml.url=http://localhost:8181
quarkus.rest-client.aggregator_yaml.url=http://localhost:8282
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# under the License.
#

quarkus.http.cors=true
quarkus.http.cors.origins=/.*/

# on kubernetes, we can configure the workflow endpoint via an env var
org.acme.loanbroker.ui.workflowURL=${WORKFLOW_URL:http://localhost:8080}
quarkus.qute.content-types."js"=text/javascript
Expand All @@ -27,11 +30,13 @@ quarkus.qute.suffixes=js,html
%dev.quarkus.http.port=8383

# profile to pack this example into a container, to use it execute activate the maven container profile, -Dcontainer
%container.quarkus.container-image.group=dev.local
%container.quarkus.container-image.registry=dev.local
%container.quarkus.container-image.group=${USER}
%container.quarkus.container-image.name=loanbroker-ui
%container.quarkus.container-image.build=true

quarkus.kubernetes.name=loanbroker-ui
quarkus.kubernetes.deploy=false
quarkus.kubernetes.deployment-target=kubernetes
quarkus.kubernetes.image-pull-policy=IfNotPresent
quarkus.kubernetes.image-pull-policy=if-not-present
quarkus.kubernetes.env.vars.workflow_url=http://loanbroker-flow.loanbroker-example.svc.cluster.local

0 comments on commit ef42ae6

Please sign in to comment.