Skip to content

Commit

Permalink
call new deployment client
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Dec 5, 2024
1 parent c50327f commit 371ff21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/runner/pubsub/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"connectrpc.com/connect"
"github.com/IBM/sarama"

deploymentpb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/deployment/v1"
ftldeploymentconnect "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/deployment/v1/ftlv1connect"
schemapb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/schema/v1"
ftlv1 "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1"
"github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect"
"github.com/TBD54566975/ftl/internal/rpc"
"github.com/TBD54566975/ftl/internal/schema"
)
Expand Down Expand Up @@ -63,8 +63,8 @@ func (p *publisher) publish(ctx context.Context, data []byte, key string, caller
//
// This is to keep pubsub working while we transition fully to Kafka for pubsub.
func (p *publisher) publishToController(ctx context.Context, data []byte, caller schema.RefKey) error {
client := rpc.ClientFromContext[ftlv1connect.ModuleServiceClient](ctx)
_, err := client.PublishEvent(ctx, connect.NewRequest(&ftlv1.PublishEventRequest{
client := rpc.ClientFromContext[ftldeploymentconnect.DeploymentServiceClient](ctx)
_, err := client.PublishEvent(ctx, connect.NewRequest(&deploymentpb.PublishEventRequest{
Topic: &schemapb.Ref{Module: p.module, Name: p.topic.Name},
Caller: caller.Name,
Body: data,
Expand Down
2 changes: 2 additions & 0 deletions backend/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ func (s *Service) deploy(ctx context.Context, key model.DeploymentKey, module *s
s.pubSub = pubSub

deploymentServiceClient := rpc.Dial(ftldeploymentconnect.NewDeploymentServiceClient, s.config.ControllerEndpoint.String(), log.Error)
ctx = rpc.ContextWithClient(ctx, deploymentServiceClient)

leaseServiceClient := rpc.Dial(ftlleaseconnect.NewLeaseServiceClient, s.config.ControllerEndpoint.String(), log.Error)

s.proxy = proxy.New(deploymentServiceClient, leaseServiceClient)
Expand Down

0 comments on commit 371ff21

Please sign in to comment.