Skip to content

Commit

Permalink
Merge pull request #370 from streamdal/dselans/relay-name-update
Browse files Browse the repository at this point in the history
include subscription id in the relay name
  • Loading branch information
dselans authored Mar 26, 2024
2 parents 3f7a227 + 2819561 commit e4b9db4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backends/gcppubsub/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,20 @@ func (g *GCPPubSub) Relay(ctx context.Context, relayOpts *opts.RelayOptions, rel
if sc != nil {
g.log.Debug("Processing message via streamdal SDK")

operationName := "relay"

if relayOpts != nil && relayOpts.GcpPubsub != nil && relayOpts.GcpPubsub.GetArgs() != nil {
if relayOpts.GcpPubsub.GetArgs().SubscriptionId == "" {
operationName = "relay-unknown-subid"
} else {
operationName = "relay-" + relayOpts.GcpPubsub.GetArgs().SubscriptionId
}
}

resp := sc.Process(ctx, &sdk.ProcessRequest{
ComponentName: "gcp-pubsub",
OperationType: sdk.OperationTypeConsumer,
OperationName: "relay",
OperationName: operationName,
Data: msg.Data,
})

Expand Down

0 comments on commit e4b9db4

Please sign in to comment.