Backendless Support
 

Deploying custom business logic timers to production

After the code for custom business logic timers (Backendless background jobs) is generated and the custom business logic is locally debugged, it is time to learn how to deploy that code to production. By "production" it means the Backendless Online service running in the cloud. It may not be an app's development ultimate production phase - a developer may still proceed to work on the application, but it is a convenient way to distinguish it from the debugging/development step.

In order to push your custom server-side code with Timers to Backendless, the CodeRunner distribution and the zip file downloaded from the Business Logic code generator, include a command line utility.

The utility name is "Deploy" and it has an appropriate extension for the supported operating systems (.sh for Linux and .bat for Windows). To run the utility, open a command prompt window and change the current directory to the /bin directory which is a part of CodeRunner SDK (and it is also present in the CBL zip downloaded from console). 

Run the utility without any arguments:

> ./Deploy.sh
[INFO] CodeRunner(tm) Backendless Debugging Utility
[INFO] Copyright(C) 2015 Backendless Corp. All rights reserved. 
[INFO] Version: 1.13 Build date: 20150320-1727
[INFO] Registering runner on: <a href="https://api.backendless.com">https://api.backendless.com</a> with secretKey: XXXX-XXXX-XXXX-XXXX
[INFO] Runner successfully registered
[INFO] Parsing event model...
[WARN] Timer's 'Reminder' start time is in the past. The timer will run accordingly to the schedule.
[INFO] Build successfully: EventModel{timers=1, eventHandlers=0}
[INFO] Deploying model to server, and starting debug...
Running custom code
[INFO] Model successfully deployed...
[INFO] Waiting for events...
[INFO] Deploying 0 event handlers and 1 timer to the server&hellip; 
[INFO] Successfully deployed all event handlers and timers. 
[INFO] If you connected to coderunner for debug - please stop debugging
[INFO] CodeRunner will shutdown now
[INFO] Debugging Utility disconnected successfully
[INFO] Thank you for using Backendless

Notice the command output informs about the quantity of timers that has been found and deployed to the application Backendless backend:

[INFO] Deploying 0 event handlers and 1 timer to the server&hellip;

Once the code is deployed, a developer can confirm it using Backendless console:

  1. Click the Business Logic icon.
  2. Select the Timers section from the list on the left.
  3. Click the Production tab:

Once a timer code is in production, it is executed entirely on the Backendless servers according to the scheduled specified in the timer code. There is also a way to run the timer on-demand using the button in the Run column on the interface shown in the screenshot above.

Review related topics:

Is article helpful?