Enhancement: Add Scheduled Queue Messages to Service Bus Binding Documentation
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 215
- Avg merge
- 4h 2m
- Merged PRs (30d)
- 1
Description
_From @graham-sportsmgmt on August 22, 2017 16:34_
The documentation doesn't mention how we can set the ScheduledEnqueueTimeUtc parameter on an output binding for a Service Bus queue (especially for node.js please)
In at least two other issues it has been mentioned that this is possible, but (a) it still needs some more details to figure out how to send this properly, and (b) it would be REALLY nice to have that in the official docs.
https://github.com/Azure/azure-webjobs-sdk-script/issues/1465
https://github.com/Azure/Azure-Functions/issues/169
> At least with C# & Node.js (and why not in F#) the Service Bus queue output already supports this e.g. if you create and put multiple messages e.g. to IAsyncCollector or create out BrokeredMessage. Within your outgoing message(s) you can control the scheduled enqueuing time:
>
> `outgoingMessage.ScheduledEnqueueTimeUtc = DateTimeOffset.UtcNow.AddSeconds(10)`
>
I have tried adding this to my function, but it just puts everything into the message and submits it immediately:
```
queueTime = new Date(Date.now() + 30000).toUTCString();
context.log('current time is ' + new Date().toUTCString() );
context.log('queueTime is ' + queueTime);
context.bindings.queueOutput = {
"message": req.body,
"ScheduledEnqueueTimeUtc": queueTime
}
context.res = {
"status": 200,
"body": {
"message": "Successfully sent message to queue"
}
};
context.done();
```
_Copied from original issue: Azure/azure-webjobs-sdk-script#1813_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.