all the refactor
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/proxy"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/telemetry"
|
||||
"git.k6n.net/mats/platform/config"
|
||||
"git.k6n.net/mats/platform/rabbit"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
)
|
||||
@@ -126,6 +127,20 @@ func main() {
|
||||
log.Fatalf("Error creating profile pool: %v\n", err)
|
||||
}
|
||||
|
||||
// Stream applied profile mutations to the shared mutations exchange (routing
|
||||
// key mutation.profile) for the backoffice live feed. Best-effort: disabled
|
||||
// when AMQP_URL is unset or the broker is unreachable.
|
||||
if amqpURL := os.Getenv("AMQP_URL"); amqpURL != "" {
|
||||
if conn, derr := rabbit.Dial(amqpURL, "cart-profile"); derr != nil {
|
||||
log.Printf("profile: AMQP connect failed, mutation feed disabled: %v", derr)
|
||||
} else {
|
||||
feed := actor.NewAmqpListener(conn.Connection(), "profile", actor.MutationSummary)
|
||||
feed.DefineTopics()
|
||||
pool.AddListener(feed)
|
||||
log.Printf("profile: mutation feed enabled (mutation.profile)")
|
||||
}
|
||||
}
|
||||
|
||||
// Clustering control plane: gRPC server on :1337 serves peer pools'
|
||||
// ownership announcements and remote Apply/Get calls; UseDiscovery watches
|
||||
// for sibling profile pods (label actor-pool=profile) and wires them into the
|
||||
|
||||
Reference in New Issue
Block a user