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.

33 lines
625 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. if config == nil {
  12. return
  13. }
  14. for _, store := range MessageQueues {
  15. if config.GetBool(store.GetName() + ".enabled") {
  16. viperSub := config.Sub(store.GetName())
  17. if err := store.Initialize(viperSub); err != nil {
  18. glog.Fatalf("Failed to initialize store for %s: %+v",
  19. store.GetName(), err)
  20. }
  21. Queue = store
  22. glog.V(0).Infof("Configure message queue for %s", store.GetName())
  23. return
  24. }
  25. }
  26. }