Periodic timer

The periodic timer is an event scheduler in the IBM Cloud Event Notifications service that generates events periodically based on cron expressions. Periodic event scheduling is important in large-scale applications where the client cannot maintain the periodic timer. Therefore, rather than relying on the client to schedule events, Event Notifications manages the scheduling of events based on a period that you define.

Scheduling an event

Step 1: Creating a topic by using the periodic timer as a source

  1. Navigate to your Event Notifications instance and click Topics. Click Add. Provide the name and description of the topic. Select Periodic Timer as the source.

    Creating a topic
    Creating a topic

  2. Define the time window and the cron expression for event scheduling. The periodic timer operates within the time window you specify. If no start time is provided, the timer starts immediately. If no end time is set, it continues to trigger until you disable it. The default cron expression and time window are displayed as shown:

    Cron Default Expression
    Cron Default Expression

    After you set the time window and define the cron expression, the scheduled events are displayed as shown:

    Setting the time period and defining Cron Expression
    Setting the time period and defining Cron Expression

    Cron Expressions:

    Syntax : <MINUTE> <HOUR> <DAY-OF-MONTH> <MONTH> <DAY-OF-WEEK>

    Cron Expressions
    Name Allowed values Allowed Special Characters
    Minutes 0-59 , - * /
    Hours 0-23 , - * /
    Day of month 1-31 , - * / ? L W
    Month 0-11 or JAN-DEC , - * /
    Day of week 1-7 or SUN-SAT , - * / ? L #

    Allowed Special Characters:

    "," - Allows extra values. For example, in the day-of-week field, sun,mon,tue includes events that are scheduled on Sunday, Monday, and Tuesday.

    "-" - Allows defining ranges. For example, in the day-of-month field 23-30 includes events that are scheduled on 23 to 30 of a month.

    "*" - Includes every value in a field. For example, in the hour field, * includes all the hours of a day.

    "/" - Specifies increments. For example, in the minute field, you can mention 1/5 to specify every fifth minute, starting from the first minute of the hour (for example, the 6th, 16th, and 26th minute, and so on).

    "?" - Allows any value in a field. For example, in the Month field if JAN was entered and in the day-of-week field if ? was entered it includes events that are scheduled on any day in JAN.

    "L" - Specifies the last day of the month/week.

    "W" - Specifies a weekday in a month. For example, In the Day-of-month field, 5W specifies the weekday closest to the fifth day of the month.

    "#" - Specifies a certain instance of the specified day of the week within a month. For example, 6#4 would be the fourth Friday of the month: 6 refers to Friday because it is the sixth day of each week, and the 4 refers to the fourth day of that type within the month.

    Click Create.

  3. Review the newly created topic.

    Reviewing Topic
    Reviewing Topic

Step 2: Creating a subscription

For more information, see Create a subscription.

After a subscription is created, an invitation email or SMS is sent to subscribe to the Event Notifications topic.

Invitation Email
Invitation Email to subscribe to topic

Step 3: Verifying that an event occurs at the scheduled time

After the event is scheduled, verify that an event occurs at the scheduled time and that a notification is sent to the destination.

Verifying Event
Email Notification when Event takes place at scheduled time