:= App{ Logger: logger, Config: &cfg, Service: service, DB: db, } msgs := app.Service.GetMessages() for { msg := <-msgs err, catch := handler(app, msg) if err != nil { app.Logger.Error("cannot handle event", zap.Error(err)) if catch { app.Service.Catch(msg, err) } } } } func handler(app *App, msg *babex.Message) (error) { ... полезная работа ... } Хоть и просто, но много проблем