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: Implement Device System Events #4101

Merged
merged 8 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ ifeq ($(INCLUDE_DELAYED_START_BUILD_SUPPORT),"false")
endif

NO_MESSAGEBUS_GO_BUILD_TAG:=no_messagebus

NO_ZMQ_GO_BUILD_TAG:=no_zmq

build: $(MICROSERVICES)

tidy:
go mod tidy

cmd/core-metadata/core-metadata:
$(GO) build -tags "$(NO_MESSAGEBUS_GO_BUILD_TAG) $(NON_DELAYED_START_GO_BUILD_TAG_FOR_CORE)" $(GOFLAGS) -o $@ ./cmd/core-metadata
$(GO) build -tags "$(NO_ZMQ_GO_BUILD_TAG) $(NON_DELAYED_START_GO_BUILD_TAG_FOR_CORE)" $(GOFLAGS) -o $@ ./cmd/core-metadata

cmd/core-data/core-data:
$(GOCGO) build -tags "$(NON_DELAYED_START_GO_BUILD_TAG_FOR_CORE)" $(CGOFLAGS) -o $@ ./cmd/core-data
Expand Down
21 changes: 21 additions & 0 deletions cmd/core-metadata/res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ Sender = "core-metadata"
Description = "Metadata change notice"
Label = "metadata"

[MessageQueue]
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
PublishTopicPrefix = "edgex/system-events" # /<source>/<type>/<action>/<owner>/<profile> will be added to this Publish Topic prefix
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageQueue.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
# Client Identifiers
ClientId ="core-metadata"
# Connection information
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
# TLS configuration - Only used if Cert/Key file or Cert/Key PEMblock are specified
SkipCertVerify = "false"

[SecretStore]
Type = "vault"
Protocol = "http"
Expand Down
9 changes: 5 additions & 4 deletions internal/core/data/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ func (c *ConfigurationStruct) UpdateWritableFromRaw(rawWritable interface{}) boo
func (c *ConfigurationStruct) GetBootstrap() bootstrapConfig.BootstrapConfiguration {
// temporary until we can make backwards-breaking configuration.toml change
return bootstrapConfig.BootstrapConfiguration{
Clients: c.Clients,
Service: c.Service,
Registry: c.Registry,
SecretStore: c.SecretStore,
Clients: c.Clients,
Service: c.Service,
Registry: c.Registry,
SecretStore: c.SecretStore,
MessageQueue: c.MessageQueue,
}
}

Expand Down
22 changes: 11 additions & 11 deletions internal/core/data/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ import (

"github.com/gorilla/mux"

"github.com/edgexfoundry/edgex-go"
"github.com/edgexfoundry/edgex-go/internal"
"github.com/edgexfoundry/edgex-go/internal/core/data/application"
"github.com/edgexfoundry/edgex-go/internal/core/data/config"
"github.com/edgexfoundry/edgex-go/internal/core/data/container"
"github.com/edgexfoundry/edgex-go/internal/core/data/messaging"
pkgHandlers "github.com/edgexfoundry/edgex-go/internal/pkg/bootstrap/handlers"
"github.com/edgexfoundry/edgex-go/internal/pkg/telemetry"
"github.com/edgexfoundry/go-mod-core-contracts/v2/common"

"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap"
"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/flags"
"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/handlers"
"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/interfaces"
"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/startup"
"github.com/edgexfoundry/go-mod-bootstrap/v2/di"
"github.com/edgexfoundry/go-mod-core-contracts/v2/common"

"github.com/edgexfoundry/edgex-go"
"github.com/edgexfoundry/edgex-go/internal"
"github.com/edgexfoundry/edgex-go/internal/core/data/application"
"github.com/edgexfoundry/edgex-go/internal/core/data/config"
"github.com/edgexfoundry/edgex-go/internal/core/data/container"
pkgHandlers "github.com/edgexfoundry/edgex-go/internal/pkg/bootstrap/handlers"
"github.com/edgexfoundry/edgex-go/internal/pkg/telemetry"
)

func Main(ctx context.Context, cancel context.CancelFunc, router *mux.Router) {
Expand Down Expand Up @@ -73,9 +73,9 @@ func Main(ctx context.Context, cancel context.CancelFunc, router *mux.Router) {
true,
[]interfaces.BootstrapHandler{
pkgHandlers.NewDatabase(httpServer, configuration, container.DBClientInterfaceName).BootstrapHandler, // add v2 db client bootstrap handler
messaging.BootstrapHandler,
handlers.MessagingBootstrapHandler,
handlers.NewServiceMetrics(common.CoreDataServiceKey).BootstrapHandler, // Must be after Messaging
application.BootstrapHandler, // Must be after Service Metrics and before next handler
application.BootstrapHandler, // Must be after Service Metrics and before next handler
NewBootstrap(router, common.CoreDataServiceKey).BootstrapHandler,
telemetry.BootstrapHandler,
httpServer.BootstrapHandler,
Expand Down
134 changes: 0 additions & 134 deletions internal/core/data/messaging/messaging.go

This file was deleted.

110 changes: 0 additions & 110 deletions internal/core/data/messaging/messaging_test.go

This file was deleted.

Loading