You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
592 B

  1. package msgqueue
  2. import (
  3. "github.com/chrislusf/seaweedfs/weed/glog"
  4. "github.com/spf13/viper"
  5. )
  6. var (
  7. MessageQueues []MessageQueue
  8. Queue MessageQueue
  9. )
  10. func LoadConfiguration(config *viper.Viper) {
  11. for _, store := range MessageQueues {
  12. if config.GetBool(store.GetName() + ".enabled") {
  13. viperSub := config.Sub(store.GetName())
  14. if err := store.Initialize(viperSub); err != nil {
  15. glog.Fatalf("Failed to initialize store for %s: %+v",
  16. store.GetName(), err)
  17. }
  18. Queue = store
  19. glog.V(0).Infof("Configure message queue for %s", store.GetName())
  20. return
  21. }
  22. }
  23. }