Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Will configuration elements for External MQTT trigger config #1493

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

lenny-goodell
Copy link
Member

closes #1117

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/app-functions-sdk-go/blob/main/.github/CONTRIBUTING.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?) N/A
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)
    TBD one refactor PR is merged

Testing Instructions

Run edgex Stack

 make run mqtt-broker mqtt-verbose no-secty

Build ASC with the SDK from this branch
Modified external-mqtt-trigger profile to add the following to Trigger.ExternalMqtt section

    Will:
      Enabled: true
      Payload: "goodbye"
      Qos: 2
      Retained: true
      Topic: "me/be/gone"

Run ASC

./app-service-configurable -d -cp -p=external-mqtt-trigger

Verify the following is in log file.

msg="Last Will options set for MQTT Trigger: {Enabled:true Payload:goodbye Qos:2 Retained:true Topic:me/be/gone}"

Verify logs for the Mqtt Broker contain

Will message specified (7 bytes) 

Connect mqtt.FX to MQTT Broker ad subscribe to me/be/gone topic
Stop ASC
Verify mqtt.FX received goodbye message on me/be/gone topic

New Dependency Instructions (If applicable)

closes edgexfoundry#1117

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
@codecov-commenter
Copy link

Codecov Report

Merging #1493 (053e043) into main (2743bc4) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main    #1493      +/-   ##
==========================================
- Coverage   67.18%   67.09%   -0.09%     
==========================================
  Files          36       36              
  Lines        3093     3097       +4     
==========================================
  Hits         2078     2078              
- Misses        881      885       +4     
  Partials      134      134              
Files Coverage Δ
internal/trigger/mqtt/mqtt.go 36.36% <0.00%> (-1.14%) ⬇️

Copy link
Contributor

@jim-wang-intel jim-wang-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lenny-goodell lenny-goodell merged commit 005c7e8 into edgexfoundry:main Oct 17, 2023
3 checks passed
@lenny-goodell lenny-goodell deleted the mqtt-will branch October 17, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to set MQTT Will options for external MQTT and MQTT export server connections
3 participants