✨ Refactor application initialization to load configuration and enhance message processing. Introduce effective subscription topic handling and improve error management in NATS consumer. Update tests for publisher error handling and add new dependency injection method for app initialization.
This commit is contained in:
@@ -244,3 +244,16 @@ func (c *Config) Validate() error {
|
||||
func ProvideConfig() (*Config, error) {
|
||||
return LoadConfig()
|
||||
}
|
||||
|
||||
// EffectiveSubscriptionTopic returns the active subscription subject.
|
||||
// Retains support for legacy config.Subscription fields while allowing
|
||||
// future consolidation.
|
||||
func (c *Config) EffectiveSubscriptionTopic() string {
|
||||
if c == nil {
|
||||
return ""
|
||||
}
|
||||
if topic := c.Subscription.Topic; topic != "" {
|
||||
return topic
|
||||
}
|
||||
return "telegram.>"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user