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.

// do not forget to call Backendless.initApp in the app initialization logic

DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.setRepeatEvery( 20 ); // the message will be delivered every 20 seconds
deliveryOptions.setRepeatExpiresAt( new Date( System.currentTimeMillis() + 60000 ) );

MessageStatus status = Backendless.Messaging.publish( 
                                    "This message was scheduled 20 sec ago", 
                                    deliveryOptions );