package Ġchat . to . server . bot . autoconfigure . scheduling Ċ Ċ import Ġchat . to . server . bot . Message Reader Ċ import Ġorg . springframework . scheduling . annotation . Scheduled Ċ Ċ class ĠMessage Receive Scheduler ( private Ġval Ġmessage Receiver : ĠMessage Receiver , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġmessage Reader : ĠMessage Reader ) Ġ{ ĊĊĠĠĠ Ġ@ Scheduled ( cron Ġ= Ġ"\ ${ chat . to . server . polling : */ 5 Ġ* Ġ* Ġ* Ġ* Ġ* }") ĊĠĠĠ Ġfun Ġschedule Receive Messages () Ġ{ ĊĠĠĠĠĠĠĠ Ġmessage Reader . retrieve Messages (). forEach ( message Receiver :: receive Message ) ĊĠĠĠ Ġ} Ċ Ċ }