I'm trying to write an azure function that supports 'retries' or future calls based on a service bus queue. It seems that the output bindings don't support any brokerProperties
in the payload, is this correct or am I simply doing it wrong?
I'm able to do future calls in the queue with the following:
const azure = require('azure-sb');
const moment = require('moment');
const scheduled_time = moment().utc().add(5, 'm').format('M/D/YYYY H:mm:ss A');
const msg =
{
body: "Testing",
brokerProperties: {
ScheduledEnqueueTimeUtc: scheduled_time
}
};
sbService.sendQueueMessage(queueName, msg, function (err) {
if (err) {
console.log('Failed Tx: ', err);
} else {
console.log('Sent ' + msg);
}
});
However, simply passing the same msg
object to the output binding the brokerProperties
seem to be ignored. I HAVE confirmed that the function output binding works in general (properly configured).
context.done(null,
{
body: "Testing",
brokerProperties: {
ScheduledEnqueueTimeUtc: scheduled_time
}
});
Is it possible to leverage output bindings to do this or do I really need to add azure-sb
and all this code for such a simple parameter? Is there a better way to call an azure function in the future?
The Node SDK docs don't even include ScheduledEnqueueTimeUtc
property so it's been impossible to find any info in the docs.