@@ -27,6 +27,7 @@ import (
2727 "github.com/apache/dubbo-admin/pkg/config/diagnostics"
2828 "github.com/apache/dubbo-admin/pkg/config/discovery"
2929 "github.com/apache/dubbo-admin/pkg/config/engine"
30+ "github.com/apache/dubbo-admin/pkg/config/eventbus"
3031 "github.com/apache/dubbo-admin/pkg/config/log"
3132 "github.com/apache/dubbo-admin/pkg/config/observability"
3233 "github.com/apache/dubbo-admin/pkg/config/store"
@@ -48,18 +49,22 @@ type AdminConfig struct {
4849 Discovery []* discovery.Config `json:"discovery" yaml:"discovery"`
4950 // Engine configuration
5051 Engine * engine.Config `json:"engine" yaml:"engine"`
52+ // EventBus configuration
53+ EventBus * eventbus.Config `json:"eventBus,omitempty" yaml:"eventBus,omitempty"`
5154}
5255
5356var _ = & AdminConfig {}
5457
5558var DefaultAdminConfig = func () AdminConfig {
59+ eventBusCfg := eventbus .Default ()
5660 return AdminConfig {
5761 Log : log .DefaultLogConfig (),
5862 Store : store .DefaultStoreConfig (),
5963 Engine : engine .DefaultResourceEngineConfig (),
6064 Observability : observability .DefaultObservabilityConfig (),
6165 Diagnostics : diagnostics .DefaultDiagnosticsConfig (),
6266 Console : console .DefaultConsoleConfig (),
67+ EventBus : & eventBusCfg ,
6368 }
6469}
6570
@@ -115,7 +120,7 @@ func (c AdminConfig) PostProcess() error {
115120 )
116121}
117122
118- func (c AdminConfig ) Validate () error {
123+ func (c * AdminConfig ) Validate () error {
119124 if c .Log == nil {
120125 c .Log = log .DefaultLogConfig ()
121126 } else if err := c .Log .Validate (); err != nil {
@@ -160,6 +165,12 @@ func (c AdminConfig) Validate() error {
160165 } else if err := c .Engine .Validate (); err != nil {
161166 return bizerror .Wrap (err , bizerror .ConfigError , "engine config validation failed" )
162167 }
168+ if c .EventBus == nil {
169+ cfg := eventbus .Default ()
170+ c .EventBus = & cfg
171+ } else if err := c .EventBus .Validate (); err != nil {
172+ return bizerror .Wrap (err , bizerror .ConfigError , "event bus config validation failed" )
173+ }
163174 return nil
164175}
165176
0 commit comments