diff --git a/go.mod b/go.mod index 85e49f7364..1625fa08b1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/edgexfoundry/go-mod-bootstrap v0.0.26 github.com/edgexfoundry/go-mod-configuration v0.0.3 github.com/edgexfoundry/go-mod-core-contracts v0.1.52 - github.com/edgexfoundry/go-mod-messaging v0.1.14 + github.com/edgexfoundry/go-mod-messaging v0.1.16 github.com/edgexfoundry/go-mod-registry v0.1.17 github.com/edgexfoundry/go-mod-secrets v0.0.17 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 diff --git a/internal/core/data/init.go b/internal/core/data/init.go index 6ee35ccab4..a238d38df9 100644 --- a/internal/core/data/init.go +++ b/internal/core/data/init.go @@ -54,6 +54,7 @@ func (b *Bootstrap) BootstrapHandler(ctx context.Context, wg *sync.WaitGroup, _ configuration := dataContainer.ConfigurationFrom(dic.Get) registryClient := container.RegistryFrom(dic.Get) + lc := container.LoggingClientFrom(dic.Get) mdc := metadata.NewDeviceClient( urlclient.New( @@ -90,12 +91,25 @@ func (b *Bootstrap) BootstrapHandler(ctx context.Context, wg *sync.WaitGroup, _ Optional: configuration.MessageQueue.Optional, }) - lc := container.LoggingClientFrom(dic.Get) if err != nil { lc.Error(fmt.Sprintf("failed to create messaging client: %s", err.Error())) return false } + err = msgClient.Connect() + if err != nil { + lc.Error(fmt.Sprintf("failed to connect to message bus: %s", err.Error())) + return false + } + + lc.Info(fmt.Sprintf( + "Connected to %s Message Bus @ %s://%s:%d publishing on '%s' topic", + configuration.MessageQueue.Type, + configuration.MessageQueue.Protocol, + configuration.MessageQueue.Host, + configuration.MessageQueue.Port, + configuration.MessageQueue.Topic)) + chEvents := make(chan interface{}, 100) // initialize event handlers initEventHandlers(lc, chEvents, mdc, msc, configuration)