Skip to content

Commit

Permalink
fix mapping of clients (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj authored Feb 21, 2024
1 parent 91da856 commit 2d64b6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions flow/connectors/eventhub/hubmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (m *EventHubManager) GetOrCreateHubClient(ctx context.Context, name ScopedE

var hubConnectOK bool
var hub any
hub, hubConnectOK = m.hubs.Load(name.Eventhub)
hub, hubConnectOK = m.hubs.Load(name.ToString())
if hubConnectOK {
hubTmp := hub.(*azeventhubs.ProducerClient)
_, err := hubTmp.GetEventHubProperties(ctx, nil)
Expand All @@ -95,7 +95,7 @@ func (m *EventHubManager) GetOrCreateHubClient(ctx context.Context, name ScopedE
if closeError != nil {
slog.Error("failed to close producer client", slog.Any("error", closeError))
}
m.hubs.Delete(name.Eventhub)
m.hubs.Delete(name.ToString())
hubConnectOK = false
}
}
Expand All @@ -112,7 +112,7 @@ func (m *EventHubManager) GetOrCreateHubClient(ctx context.Context, name ScopedE
if err != nil {
return nil, fmt.Errorf("failed to create eventhub client: %v", err)
}
m.hubs.Store(name.Eventhub, hub)
m.hubs.Store(name.ToString(), hub)
return hub, nil
}

Expand Down
2 changes: 1 addition & 1 deletion flow/connectors/eventhub/scoped_eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ func (s ScopedEventhub) Equals(other ScopedEventhub) bool {

// ToString returns the string representation of the ScopedEventhub
func (s ScopedEventhub) ToString() string {
return fmt.Sprintf("%s.%s.%s.%s", s.PeerName, s.Eventhub, s.PartitionKeyColumn, s.PartitionKeyValue)
return fmt.Sprintf("%s.%s", s.PeerName, s.Eventhub)
}

0 comments on commit 2d64b6a

Please sign in to comment.