Skip to content

Repeated Publish

Backendless supports repeated message processing - a message is published once, but is delivered to subscribers with the specified frequency. Repeated delivery will stop either at the specified time unless it is canceled using the message cancellation API.

var channel = "TestChannel",
    message = "Hello, world!",
    pubOps = null;
    deliveryOps = new Backendless.DeliveryOptions({
        // frequency in seconds
        repeatEvery: 10, 

        // expiration timestamp (in milliseconds), eg: after 1 minute
        repeatExpiresAt: (new Date()).getTime() + 60 * 1000 
    });

Backendless.Messaging.publish( channel, message, pubOps, deliveryOps )
 .then( function( response ) {
  })
 .catch( function( error ) {
  });