Commit ea7e9749 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in V2X messages publishing mechanism

parent 8faf0814
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -849,6 +849,7 @@ func V2xMsgPublicationPOST(w http.ResponseWriter, r *http.Request) {
		return
	}

	if len(v2xMsgSubscriptionMap) != 0 { // There are some subscription ongoing, we can publish it
		// Publish message on message broker
		var msgType *int32 = nil
		if v2xMsgPubReq.MsgType != nil {
@@ -860,6 +861,11 @@ func V2xMsgPublicationPOST(w http.ResponseWriter, r *http.Request) {
			w.WriteHeader(http.StatusInternalServerError)
		}
		w.WriteHeader(http.StatusNoContent)
	} else { // No subscription ongoing, discard it
		log.Error("No subscription ongoing, discard it")
		errHandlerProblemDetails(w, "No subscription ongoing, discard it.", http.StatusBadRequest)
		return
	}

	/***
	// V2xMsgPub id will be generated sequentially
+6 −0
Original line number Diff line number Diff line
@@ -936,6 +936,11 @@ func (tm *TrafficMgr) GetInfoUuUnicast(params []string, num_item int) (proInfoUu
}

func (tm *TrafficMgr) PublishMessageOnMessageBroker(msgContent string, msgEncodeFormat string, stdOrganization string, msgType *int32) (err error) {
	if !brokerRunning {
		err = errors.New("Message broker mechanism not initialized")
		log.Error(err.Error())
		return err
	}
	return tm.message_broker.Send(tm, msgContent, msgEncodeFormat, stdOrganization, msgType)
}

@@ -948,6 +953,7 @@ func (tm *TrafficMgr) StartV2xMessageBrokerServer() (err error) {
	u, err := url.ParseRequestURI(tm.broker)
	if err != nil {
		err = errors.New("Failed to parse url " + tm.broker)
		log.Error(err.Error())
		return err
	}
	log.Info("url:%v\nscheme:%v host:%v Path:%v Port:%s", u, u.Scheme, u.Hostname(), u.Path, u.Port())
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+36 −3
Original line number Diff line number Diff line
#!/bin/sh -e

#set -vx
set -vx

DESC="AdvantEDGE platform"
PLTF="Unknown"
@@ -15,6 +15,8 @@ start_advantedge() {
        meepctl deploy core
        sleep $TIMEOUT
        kubectl get pods --all-namespaces
        sleep $TIMEOUT
	IS_RUNNING=`kubectl get pods --all-namespaces | grep "meep-virt-engine" | awk '{print $2}'`
    fi
}

@@ -27,6 +29,7 @@ stop_avdantedge() {
        kubectl get pods --all-namespaces
        sleep $TIMEOUT
        #helm delete --no-hooks meep-prometheus
	IS_RUNNING=`kubectl get pods --all-namespaces | grep "meep-virt-engine" | awk '{print $2}'`
   fi
}

@@ -41,7 +44,9 @@ switch_to_advantedge_pltf() {
    rm -fr charts/grafana/dashboards/mec-sandbox.json config/api/ config/permissions.yaml
    cp .meepctl-repocfg_adv.yaml .meepctl-repocfg.yaml
    git checkout --force config/objstore-thanos-archive.yaml config/objstore-thanos.yaml config/secrets.yaml examples/demo4-ue/src/demo-server/entrypoint.sh
    sudo rm -fr ../.meep_sandbox ; mv ../.meep ../.meep_sandbox

    build_advantedge
    start_advantedge
}

@@ -53,11 +58,13 @@ switch_to_sandbox_pltf() {
    fi

    stop_avdantedge
    sudo rm -fr ../.meep_advantedge ; mv ../.meep ../.meep_advantedge   
    cd ../mec-sandbox
    ./build.sh
    ./deploy.sh
    cd -

    python3 ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml
    build_advantedge
    start_advantedge
}

@@ -99,6 +106,32 @@ check_backup() {
    fi
}

build_advantedge() {
    meepctl deploy dep
    sleep $TIMEOUT
    rm -fr $ADV_PATH/bin/meep-*
    if [ "$DO_NOT_BUILD_EX" != "--noexamplesbuilt" ]; then
        build_examples
    fi
    meepctl build all --nolint
    meepctl dockerize all
    meepctl delete dep
    sleep $TIMEOUT
}

build_examples() {
    cd $ADV_PATH/examples/demo1
    ./build-demo1.sh && ./dockerize.sh
    cd $ADV_PATH/examples/demo2
    ./build-demo2.sh &&
    cd $ADV_PATH/examples/demo3
    ./build-demo3.sh && ./dockerize.sh
    cd $ADV_PATH/examples/demo4-ue
    ./build-demo4-ue.sh && ./dockerize.sh
    cd $ADV_PATH/examples/demo5
    ./build-demo5.sh && ./dockerize.sh
}

check_backup

case "$1" in