-
Notifications
You must be signed in to change notification settings - Fork 13
/
operations.go
24 lines (20 loc) · 916 Bytes
/
operations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package receivers
import (
log "github.com/sirupsen/logrus"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/microsoft/commercial-marketplace-offer-deploy/cmd/operator/handlers"
"github.com/microsoft/commercial-marketplace-offer-deploy/internal/config"
"github.com/microsoft/commercial-marketplace-offer-deploy/internal/messaging"
)
func NewOperationsMessageReceiver(appConfig *config.AppConfig, credential azcore.TokenCredential) messaging.MessageReceiver {
handler := handlers.NewOperationsMessageHandler(appConfig)
options := messaging.ServiceBusMessageReceiverOptions{
MessageReceiverOptions: messaging.MessageReceiverOptions{QueueName: string(messaging.QueueNameOperations)},
FullyQualifiedNamespace: appConfig.Azure.GetFullQualifiedNamespace(),
}
receiver, err := messaging.NewServiceBusReceiver(handler, credential, options)
if err != nil {
log.Fatal(err)
}
return receiver
}