discovery: +invoke url

This commit is contained in:
Stephan D
2026-01-19 11:07:21 +01:00
parent 1eb5a918a0
commit 64803a21e0
26 changed files with 170 additions and 32 deletions

View File

@@ -184,7 +184,12 @@ func (i *Imp) Start() error {
)
serviceFactory := func(logger mlogger.Logger, _ struct{}, producer msg.Producer) (grpcapp.Service, error) {
invokeURI := ""
if cfg.GRPC != nil {
invokeURI = cfg.GRPC.DiscoveryInvokeURI()
}
svc := mntxservice.NewService(logger,
mntxservice.WithDiscoveryInvokeURI(invokeURI),
mntxservice.WithProducer(producer),
mntxservice.WithMonetixConfig(monetixCfg),
mntxservice.WithGatewayDescriptor(gatewayDescriptor),

View File

@@ -2,6 +2,7 @@ package gateway
import (
"net/http"
"strings"
"github.com/tech/sendico/gateway/mntx/internal/service/monetix"
"github.com/tech/sendico/pkg/clock"
@@ -52,3 +53,10 @@ func WithGatewayDescriptor(descriptor *gatewayv1.GatewayInstanceDescriptor) Opti
}
}
}
// WithDiscoveryInvokeURI sets the invoke URI used when announcing the gateway.
func WithDiscoveryInvokeURI(invokeURI string) Option {
return func(s *Service) {
s.invokeURI = strings.TrimSpace(invokeURI)
}
}

View File

@@ -30,6 +30,7 @@ type Service struct {
card *cardPayoutProcessor
gatewayDescriptor *gatewayv1.GatewayInstanceDescriptor
announcer *discovery.Announcer
invokeURI string
connectorv1.UnimplementedConnectorServiceServer
}
@@ -145,7 +146,7 @@ func (s *Service) startDiscoveryAnnouncer() {
Service: "CARD_PAYOUT_RAIL_GATEWAY",
Rail: "CARD_PAYOUT",
Operations: []string{"payout.card"},
InvokeURI: discovery.DefaultInvokeURI(string(mservice.MntxGateway)),
InvokeURI: s.invokeURI,
Version: appversion.Create().Short(),
}
if s.gatewayDescriptor != nil {