🔧 Update Go module dependencies and modify NATS configuration to exclusively support JetStream mode. Upgrade go.uber.org/zap to version 1.27.1 and golang.org/x/crypto to version 0.45.0. Revise Makefile and documentation to reflect changes in NATS mode, ensuring consistent messaging behavior across development and production environments. Enhance README and configuration files to clarify JetStream usage and remove references to Core NATS mode.

This commit is contained in:
windyboy
2025-11-21 09:59:47 +08:00
parent ee7cac95f0
commit 6eff35b56f
16 changed files with 91 additions and 382 deletions
-7
View File
@@ -72,14 +72,7 @@ func ProvideNATSConn(cfg *config.Config, logger *zap.Logger) (*nats.Conn, error)
}
// ProvideJetStream creates a JetStream context from a NATS connection.
// Returns nil when mode is "core" to indicate JetStream should not be used.
func ProvideJetStream(nc *nats.Conn, cfg *config.Config, logger *zap.Logger) (nats.JetStreamContext, error) {
// In core mode, return nil so that publishers/consumers use core NATS
if cfg.NATS.Mode == "core" {
logger.Debug("Skipping JetStream initialization (core mode)")
return nil, nil
}
js, err := nc.JetStream()
if err != nil {
logger.Error("failed to create JetStream context", zap.Error(err))