edgexfoundry / app-functions-sdk-go

Owner: Applications WG
Apache License 2.0
43 stars 83 forks source link

Change TargetType value from Consul didn't effect before restart service #1361

Closed cherrycl closed 1 year ago

cherrycl commented 1 year ago

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: app-services ### Is this a regression? Yes ### Description and Minimal Reproduction [**REQUIRED**] [Reproduce steps] 1. Deploy edgex by [taf-no-secty compose file](https://github.com/edgexfoundry/edgex-compose/blob/1608a6e3626264b0360ef889643cfc3f3a83af0b/taf/docker-compose-taf-no-secty.yml). 2. Update `Writable.Pipeline.TargetType` to `raw` for app-functional-tests from Consul. 3. Send the following API to `app-functional-tests` container. `POST` http://localhost:59705/api/v2/trigger Requst body: ```json { "id":"5bd794de0e36080001f53eab", "origin":1540855006469, "readings":[ { "id":"5bd794de0e36080001f53eac", "origin":1540855006469, "device":"Random-Float-Device", "name":"RandomValue_Float64", "value":"QAFk2HxRUOo=" } ] } ## πŸ”₯ Exception or Error

Return `400` status code.
Response body : unable to process payload AddEventRequest.BaseRequest.Versionable.ApiVersion field is required ....
After restarting `app-functional-test`, got the expected result. [Expected result] Return `422` status code. Response body: FilterByDeviceName: type received is not an Event in pipeline 'default-pipeline' ## 🌍 Your Environment **Deployment Environment:** ubuntu / x86 **EdgeX Version [**REQUIRED**]:** main **Anything else relevant?** Similar with #1006
lenny-goodell commented 1 year ago

@cherrycl , UseTargetTypeOfByteArray no longer exists. It has been changed to TargetType with valid values of raw , event or metric.

I did see your issue when I changed it to raw via Consul

cherrycl commented 1 year ago

@lenny-intel Sorry, I got mistake on the description. I did use TargetType on this test. The description has been updated.

lenny-goodell commented 1 year ago

@cherrycl , this PR resolves this issue once it is propagated to ASC https://github.com/edgexfoundry/go-mod-bootstrap/pull/502

lenny-goodell commented 1 year ago

@cherrycl, above fix has been propagated to ASC. Please verify that this has now been resolved. THX!

cherrycl commented 1 year ago

Fixed.