Description
Returns a message in the Azure Service Bus queue using a SAS key name/value pair for authentication. It then locks the message in the queue and returns for processing.
Note: This function is always used in conjunction with the function AzureServiceBusDeleteMessage which deletes the message after AzureServiceBusPeekLockMessage is finished.
Signature
AzureServiceBusPeekLockMessage( 'servicebusqueueurl', 'sas-key-name', 'sas-key-value', 'namespaceurl' )
Example - ServiceBus Queue
The example below uses a SAS key name/value pair to look at a message in a queue named 'n52bpa'. It is then deleted by AzureServiceBusDeleteMessage.
SmartFlow(
AzureServiceBusPeekLockMessage(
'https://n52bpa-sb-north52v2.servicebus.windows.net/n52bpa/messages/head',
'RootManageSharedAccessKey',
'HKutpM**************nfkx6gI1VyppEFAI22',
'https://n52bpa-sb-north52v2.servicebus.windows.net'
),
Setvar('messageid',
GetVarJsonValue('MessageId',
'',
GetVarHeaderValue('BrokerProperties')) ),
Setvar('locktoken',
GetVarJsonValue('LockToken',
'',
GetVarHeaderValue('BrokerProperties')) ),
/*Do your processing steps here*/
AzureServiceBusDeleteMessage(
'https://n52bpa-sb-north52v2.servicebus.windows.net/n52bpa/messages/' +
GetVar('messageid') + '/' + GetVar('locktoken'),
'RootManageSharedAccessKey',
'HKutpM**************nfkx6gI1VyppEFAI22',
'https://n52bpa-sb-north52v2.servicebus.windows.net'
)
)
Example - ServiceBus Topic and Subscription
The example below uses a SAS key name/value pair to look at a message in a subscription 'sub1' of a topic named 'n52bpa'. It is then deleted by AzureServiceBusDeleteMessage.
SmartFlow(
AzureServiceBusPeekLockMessage(
'https://north52.servicebus.windows.net/n52bpa/subscriptions/sub1/messages/head',
'RootManageSharedAccessKey',
'jXlZa***************i/UE2wJmDiLbYt6WLU=',
'https://north52.servicebus.windows.net/'
),
Setvar('messageid',
GetVarJsonValue('MessageId',
'',
GetVarHeaderValue('BrokerProperties')) ),
Setvar('locktoken',
GetVarJsonValue('LockToken',
'',
GetVarHeaderValue('BrokerProperties')) ),
/*Do your processing steps here*/
AzureServiceBusDeleteMessage(
'https://north52.servicebus.windows.net/n52bpa/subscriptions/sub1/messages/' +
GetVar('messageid') + '/' + GetVar('locktoken'),
'RootManageSharedAccessKey',
'jXlZa***************i/UE2wJmDiLbYt6WLU=',
'https://north52.servicebus.windows.net/'
)
)
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| fromdate | xxxx | xxxx | xxxx |
| todate | xxxx | xxxx | xxxx |
| interval | xxxx | xxxx | xxxx |
