3

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.

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
rjbez
  • 802
  • 2
  • 12
  • 21
  • See this answer https://stackoverflow.com/questions/39116319/send-message-from-an-azure-servicebus-topic-after-a-specific-delay-with-node-js/ – Thomas Mar 21 '18 at 19:23
  • @Thomas that refers to the service bus library which I have working. I'm trying to get it working with an output binding. – rjbez Mar 21 '18 at 19:32
  • Have a look here, it seems that there is an open issue https://github.com/Azure/Azure-Functions/issues/454 – Thomas Mar 21 '18 at 23:46
  • @Thomas that seems to be what I'm looking for. I'm not sure why this didn't come up in any of my searching. – rjbez Mar 22 '18 at 01:55

1 Answers1

1

It is does not seems to be supported ATM, see this Github Issue:

Thomas
  • 24,234
  • 6
  • 81
  • 125