Resolved review comments

This commit is contained in:
MohitKatare-protean
2025-05-14 16:11:28 +05:30
parent ed32b57a80
commit 20883902fb
2 changed files with 37 additions and 25 deletions

View File

@@ -68,8 +68,7 @@ func GetConnURL(cfg *Config) (string, error) {
if user == "" || pass == "" {
return "", model.NewBadReqErr(fmt.Errorf("missing RabbitMQ credentials in environment"))
}
parts := strings.SplitN(cfg.Addr, "/", 2)
parts := strings.SplitN(strings.TrimSpace(cfg.Addr), "/", 2)
hostPort := parts[0]
vhost := "/"
if len(parts) > 1 {
@@ -93,7 +92,8 @@ func GetConnURL(cfg *Config) (string, error) {
}
connURL := fmt.Sprintf("%s://%s:%s@%s/%s", protocol, encodedUser, encodedPass, hostPort, encodedVHost)
log.Debugf(context.Background(), "Generated RabbitMQ connection URL: %s", connURL)
log.Debugf(context.Background(), "Generated RabbitMQ connection details: protocol=%s, hostPort=%s, vhost=%s", protocol, hostPort, vhost)
return connURL, nil
}