Skip to content

Commit

Permalink
Merge pull request #3634 from VajiraPrabuddhaka/asb-amqp-ws-fix
Browse files Browse the repository at this point in the history
[choreo] Fix: propely get AmqpOverWebsocketsEnabled flag
  • Loading branch information
VajiraPrabuddhaka authored Jan 10, 2025
2 parents 8798db2 + a3a2b0a commit c216bf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adapter/internal/messaging/azure_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func InitiateAndProcessEvents(config *config.Config) {
subscription, err := msg.InitiateBrokerConnectionAndValidate(
topic.ConnectionString,
topic.TopicName,
getAmqpClientOptions(config),
getAmqpClientOptions(topic.AmqpOverWebsocketsEnabled),
componentName,
topic.ReconnectRetryCount,
topic.ReconnectInterval*time.Millisecond,
Expand All @@ -89,7 +89,7 @@ func InitiateAndProcessEvents(config *config.Config) {
subscription, err := msg.InitiateBrokerConnectionAndValidate(
connectionString,
topic,
getAmqpClientOptions(config),
getAmqpClientOptions(config.ControlPlane.BrokerConnectionParameters.AmqpOverWebsocketsEnabled),
componentName,
reconnectRetryCount,
reconnectInterval*time.Millisecond,
Expand Down Expand Up @@ -118,8 +118,8 @@ func startChannelConsumer(consumerType string) {
}
}

func getAmqpClientOptions(config *config.Config) *azservicebus.ClientOptions {
if config.ControlPlane.BrokerConnectionParameters.AmqpOverWebsocketsEnabled {
func getAmqpClientOptions(isAmqpOverWebsocketsEnabled bool) *azservicebus.ClientOptions {
if isAmqpOverWebsocketsEnabled {
logger.LoggerMgw.Info("AMQP over Websockets is enabled. Initiating brokers with AMQP over Websockets.")
newWebSocketConnFn := func(ctx context.Context, args azservicebus.NewWebSocketConnArgs) (net.Conn, error) {
opts := &websocket.DialOptions{Subprotocols: []string{"amqp"}}
Expand Down

0 comments on commit c216bf6

Please sign in to comment.