Introduce "noop" go-micro broker

This introduces a no op broker for go-micro. It is set as the default
broker for all ocis http services. To avoid starting the default http
broker, which opens an unused random http port.

Fixes: https://github.com/owncloud/ocis/issues/3829
This commit is contained in:
Ralf Haferkamp
2022-09-14 12:22:23 +02:00
parent 41896fde34
commit fffd49fc4e
6 changed files with 55 additions and 6 deletions
-3
View File
@@ -6,7 +6,6 @@ import (
"github.com/owncloud/ocis/v2/ocis-pkg/log"
oregistry "github.com/owncloud/ocis/v2/ocis-pkg/registry"
"go-micro.dev/v4/broker"
"go-micro.dev/v4/registry"
)
@@ -20,7 +19,6 @@ func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, ver
}
ocisRegistry := oregistry.GetRegistry()
node.Metadata["broker"] = broker.String()
node.Metadata["registry"] = ocisRegistry.String()
node.Metadata["server"] = "grpc"
node.Metadata["transport"] = "grpc"
@@ -76,7 +74,6 @@ func RegisterHTTPEndpoint(ctx context.Context, serviceID, uuid, addr string, ver
}
ocisRegistry := oregistry.GetRegistry()
node.Metadata["broker"] = broker.String()
node.Metadata["registry"] = ocisRegistry.String()
node.Metadata["server"] = "http"
node.Metadata["transport"] = "http"