X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sample-services%2Fics-producer-consumer%2Fstart.sh;h=7ddc908036581118a7a918e8647bd12e363b2173;hb=HEAD;hp=18317a048c8320c860835a754e9141ff0600eed4;hpb=af9b38ae549e2d6a128a00e5d8b9f5f56fc32755;p=nonrtric.git diff --git a/sample-services/ics-producer-consumer/start.sh b/sample-services/ics-producer-consumer/start.sh index 18317a04..7ddc9080 100755 --- a/sample-services/ics-producer-consumer/start.sh +++ b/sample-services/ics-producer-consumer/start.sh @@ -71,16 +71,6 @@ wait_for_container "kafka-consumer" "Started Application" echo "Kafka container is up and running. Starting producer and consumer..." space -echo "Start 1 Producer on mytopic" -curl -X GET http://localhost:8080/startProducer/mytopic -space - -echo "Start 1 Consumer on mytopic" -curl -X GET http://localhost:8081/startConsumer/mytopic -space - -sleep 10 - echo "Sending type1 to ICS" curl -X 'PUT' \ 'http://localhost:8083/data-producer/v1/info-types/type1' \ @@ -91,8 +81,9 @@ curl -X 'PUT' \ "$schema":"http://json-schema.org/draft-07/schema#", "title":"STD_Type1_1.0.0", "description":"Type 1", - "type":"object" - } + "topic": "mytopic", + "bootStrapServers": "kafka-zkless:9092" + } }' echo "Getting types from ICS" @@ -127,8 +118,8 @@ curl -X 'PUT' \ "job_definition": { "deliveryInfo": { "topic": "mytopic", - "bootStrapServers": "http://kafka-zkless:9092", - "numberOfMessages": 0 + "bootStrapServers": "kafka-zkless:9092", + "numberOfMessages": 100 } }, "job_result_uri": "http://kafka-producer:8080/producer/job", @@ -145,14 +136,40 @@ curl -X 'PUT' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ - "status_result_uri": "http://kafka-consumer:8081/info-type-status", - "owner": "owner" + "status_result_uri": "http://kafka-consumer:8081/consumer/info-type-status", + "owner": "demo" }' echo "Getting Consumer Subscription Job infos from ICS" curl -X 'GET' 'http://localhost:8083/data-consumer/v1/info-type-subscription/1' -H 'accept: application/json' space -sleep 5 +#To Set Kafka Broker in Consumer +echo "Sending type1 to ICS to use the callback" +curl -X 'PUT' \ + 'http://localhost:8083/data-producer/v1/info-types/type1' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "info_job_data_schema": { + "$schema":"http://json-schema.org/draft-07/schema#", + "title":"STD_Type1_1.0.0", + "description":"Type 1", + "topic": "mytopic", + "bootStrapServers": "kafka-zkless:9092" + } +}' + +#Using the autostart flag in the application.yaml +echo "Start 1 Producer on mytopic" +curl -X GET http://localhost:8080/startProducer/mytopic +space + +echo "Start 1 Consumer on mytopic" +curl -X GET http://localhost:8081/startConsumer/mytopic +space + +sleep 10 + echo "ICS Producer Docker logs " docker logs informationcoordinatorservice | grep -E 'o.o.i.c.r1producer.ProducerCallbacks|o.o.i.repository.InfoTypeSubscriptions' space @@ -170,6 +187,7 @@ containers=("kafka-producer" "kafka-consumer") for container in "${containers[@]}"; do if docker logs "$container" | grep -q ERROR; then echo "Errors found in logs of $container" + docker logs "$container" | grep ERROR echo "FAIL" exit 1 else