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(factory): Support Custom Client Types #75

Closed
wants to merge 0 commits into from
Closed

feat(factory): Support Custom Client Types #75

wants to merge 0 commits into from

Conversation

AlexCuse
Copy link
Contributor

@AlexCuse AlexCuse commented Nov 2, 2020

Enable registration of custom type with factory and use on client
creation if configured type doesn't match any predefined option.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-messaging/blob/master/.github/Contributing.md.

What is the current behavior?

Only predefined messagebus client types are supported

Issue Number:

#74

What is the new behavior?

Using messaging.RegisterCustomType a factory function can be registered to create clients for a given configured type. This is stored in a map that is checked before returning error if the configured type does not match any predefined option.

Does this PR introduce a breaking change?

  • Yes
  • No

New Imports

  • Yes
  • No

Specific Instructions

Are there any specific instructions or things that should be known prior to reviewing?

Other information

@codecov-io
Copy link

Codecov Report

Merging #75 into master will decrease coverage by 0.53%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
- Coverage   83.33%   82.79%   -0.54%     
==========================================
  Files          14       14              
  Lines         504      436      -68     
==========================================
- Hits          420      361      -59     
+ Misses         64       55       -9     
  Partials       20       20              
Impacted Files Coverage Δ
...nternal/pkg/redis/streams/configuration_options.go 60.00% <ø> (-6.67%) ⬇️
pkg/types/message_envelope.go 100.00% <ø> (ø)
internal/pkg/redis/streams/client.go 94.80% <100.00%> (-0.49%) ⬇️
messaging/factory.go 86.66% <100.00%> (+3.33%) ⬆️
pkg/types/host_info.go 60.00% <0.00%> (-11.43%) ⬇️
internal/pkg/zeromq/subscriber.go 55.55% <0.00%> (-4.45%) ⬇️
internal/pkg/zeromq/client.go 75.72% <0.00%> (-2.05%) ⬇️
internal/pkg/mqtt/client_options.go 85.29% <0.00%> (-0.82%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bdc968...10a00b9. Read the comment docs.

@lenny-goodell lenny-goodell marked this pull request as draft November 2, 2020 16:27
@lenny-goodell lenny-goodell added the hold Intended for PRs we want to flag for ongoing review label Nov 2, 2020
@lenny-goodell
Copy link
Member

@AlexCuse , we are in code freeze for Hanoi, so I have switch this PR to draft and marked in on-hold.

@AlexCuse
Copy link
Contributor Author

Just wanted to check in to see if this needs anything else. Forgot about it for awhile but digging back in here today.

@lenny-goodell lenny-goodell removed the hold Intended for PRs we want to flag for ongoing review label Dec 17, 2020
@lenny-goodell
Copy link
Member

Nope, just hadn't got back to looking at it. Will do now.

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.

None yet

3 participants