Vertx.io Scheduling TasksJava library class to handle scheduled execution of “callbacks”?Schedule method invocation C#Oracle scheduled tasks?Scheduling a time in the future to send an email in Java or PythonScheduling a dynamic asp.net function?What's the easiest way to schedule a function to run at a specific time using C#Java enterprise architecture for delegating tasks between applicationsEmail Scheduler in C# using WCFIstio request tracing for vert.x event bus messagesVertx Websocket: Load Balancing
Can I criticise the more senior developers around me for not writing clean code?
Checks user level and limit the data before saving it to mongoDB
Multiple options vs single option UI
How to write a column outside the braces in a matrix?
How can I practically buy stocks?
Extension of 2-adic valuation to the real numbers
Why does nature favour the Laplacian?
Is it idiomatic to construct against `this`
Map of water taps to fill bottles
a sore throat vs a strep throat vs strep throat
How to limit Drive Letters Windows assigns to new removable USB drives
Re-entry to Germany after vacation using blue card
What causes platform events to fail to be published and should I cater for failed platform event creations?
Is Diceware more secure than a long passphrase?
Pre-plastic human skin alternative
Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?
"You've called the wrong number" or "You called the wrong number"
Implications of cigar-shaped bodies having rings?
Can't get 5V 3A DC constant
Was there a shared-world project before "Thieves World"?
Rivers without rain
bldc motor, esc and battery draw, nominal vs peak
Can someone publish a story that happened to you?
Elements that can bond to themselves?
Vertx.io Scheduling Tasks
Java library class to handle scheduled execution of “callbacks”?Schedule method invocation C#Oracle scheduled tasks?Scheduling a time in the future to send an email in Java or PythonScheduling a dynamic asp.net function?What's the easiest way to schedule a function to run at a specific time using C#Java enterprise architecture for delegating tasks between applicationsEmail Scheduler in C# using WCFIstio request tracing for vert.x event bus messagesVertx Websocket: Load Balancing
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
There is a system at a company I just started working for. The system allows clients to manage their subscriber notifications via SMS. Users log in via a web application and create messages (each message has a send date_time, destination phone_number etc). These messages are saved in a mysql database. They also have a java application implemented using jsvc. This application keeps reading the database 24/7 every 1 minute and sending the messages (via an external network provider API), that is for very message that should be sent at that particular time.
I've been brought in to rewrite the whole thing. Currently I can't change anything that deals with the web application and the database. I'm only trying to rewrite the jsvc using vertx.
I already have already written vertx service that communicates with the db and another service that communicates with the external API.
I have thought of creating a periodic function that runs every hour (it reads the database and gets all the messages that should be sent within the next one hour) and then schedules this messages to be sent to the service that communicates with external API.
My question is, how would I achieve such scheduling? The send date_time of each message is precise to the minute in the database. I'm looking at Chime and how to incorporate it but I haven't seen a good example to help me know the proper way to do it.
So, what is the proper way to use Chime to schedule eventbus messages to the external API service and is there another way I can structure this use case?
java scheduling vert.x
add a comment |
There is a system at a company I just started working for. The system allows clients to manage their subscriber notifications via SMS. Users log in via a web application and create messages (each message has a send date_time, destination phone_number etc). These messages are saved in a mysql database. They also have a java application implemented using jsvc. This application keeps reading the database 24/7 every 1 minute and sending the messages (via an external network provider API), that is for very message that should be sent at that particular time.
I've been brought in to rewrite the whole thing. Currently I can't change anything that deals with the web application and the database. I'm only trying to rewrite the jsvc using vertx.
I already have already written vertx service that communicates with the db and another service that communicates with the external API.
I have thought of creating a periodic function that runs every hour (it reads the database and gets all the messages that should be sent within the next one hour) and then schedules this messages to be sent to the service that communicates with external API.
My question is, how would I achieve such scheduling? The send date_time of each message is precise to the minute in the database. I'm looking at Chime and how to incorporate it but I haven't seen a good example to help me know the proper way to do it.
So, what is the proper way to use Chime to schedule eventbus messages to the external API service and is there another way I can structure this use case?
java scheduling vert.x
add a comment |
There is a system at a company I just started working for. The system allows clients to manage their subscriber notifications via SMS. Users log in via a web application and create messages (each message has a send date_time, destination phone_number etc). These messages are saved in a mysql database. They also have a java application implemented using jsvc. This application keeps reading the database 24/7 every 1 minute and sending the messages (via an external network provider API), that is for very message that should be sent at that particular time.
I've been brought in to rewrite the whole thing. Currently I can't change anything that deals with the web application and the database. I'm only trying to rewrite the jsvc using vertx.
I already have already written vertx service that communicates with the db and another service that communicates with the external API.
I have thought of creating a periodic function that runs every hour (it reads the database and gets all the messages that should be sent within the next one hour) and then schedules this messages to be sent to the service that communicates with external API.
My question is, how would I achieve such scheduling? The send date_time of each message is precise to the minute in the database. I'm looking at Chime and how to incorporate it but I haven't seen a good example to help me know the proper way to do it.
So, what is the proper way to use Chime to schedule eventbus messages to the external API service and is there another way I can structure this use case?
java scheduling vert.x
There is a system at a company I just started working for. The system allows clients to manage their subscriber notifications via SMS. Users log in via a web application and create messages (each message has a send date_time, destination phone_number etc). These messages are saved in a mysql database. They also have a java application implemented using jsvc. This application keeps reading the database 24/7 every 1 minute and sending the messages (via an external network provider API), that is for very message that should be sent at that particular time.
I've been brought in to rewrite the whole thing. Currently I can't change anything that deals with the web application and the database. I'm only trying to rewrite the jsvc using vertx.
I already have already written vertx service that communicates with the db and another service that communicates with the external API.
I have thought of creating a periodic function that runs every hour (it reads the database and gets all the messages that should be sent within the next one hour) and then schedules this messages to be sent to the service that communicates with external API.
My question is, how would I achieve such scheduling? The send date_time of each message is precise to the minute in the database. I'm looking at Chime and how to incorporate it but I haven't seen a good example to help me know the proper way to do it.
So, what is the proper way to use Chime to schedule eventbus messages to the external API service and is there another way I can structure this use case?
java scheduling vert.x
java scheduling vert.x
asked Mar 7 at 15:36
ObbyObby
388
388
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Vert.x provides you with setPeriodic() for that.
You can run a job every hour with something like:
vertx.setPeriodic(1000 * 60 * 60, (l) ->
// Your code here
);
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
add a comment |
Look into Java timer for scheduling or RabbitMQ-client.
public void timerSchdule()
TimerTask repeatedTask = new TimerTask()
public void run()
System.out.println("performing activity on " + new Date());
;
Timer timer = new Timer("Timer");
long delay = 1000L;
long period = 1000L * 60L * 60L * 24L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047547%2fvertx-io-scheduling-tasks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Vert.x provides you with setPeriodic() for that.
You can run a job every hour with something like:
vertx.setPeriodic(1000 * 60 * 60, (l) ->
// Your code here
);
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
add a comment |
Vert.x provides you with setPeriodic() for that.
You can run a job every hour with something like:
vertx.setPeriodic(1000 * 60 * 60, (l) ->
// Your code here
);
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
add a comment |
Vert.x provides you with setPeriodic() for that.
You can run a job every hour with something like:
vertx.setPeriodic(1000 * 60 * 60, (l) ->
// Your code here
);
Vert.x provides you with setPeriodic() for that.
You can run a job every hour with something like:
vertx.setPeriodic(1000 * 60 * 60, (l) ->
// Your code here
);
answered Mar 8 at 9:43
Alexey SoshinAlexey Soshin
7,4112614
7,4112614
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
add a comment |
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
I'm actually using this. The problem is, when it runs, it will select all messages to be sent within the next hour from the database, remember all this messages may have different minute setting. let's say the periodic runs at 10 am, Selects all messages to be sent between 10am and 11am. Some messages may be sent immediately at 10am, others at 10.15, 10.20, 10.30, 10.45 e.t.c. Those are the ones I need to schedule within the hour
– Obby
Mar 9 at 10:10
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
Your period should be the minimum amount of time between messages. If you can specify something like 10:17, run this task every minute and check. If you can only specify 5ths of minutes, run this job every 5 minutes.
– Alexey Soshin
Mar 9 at 10:20
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
I really wanted to avoid running it every minute because not every minute will have a message. I'm currently looking at vertx-cron, will see how it goes
– Obby
Mar 9 at 11:19
add a comment |
Look into Java timer for scheduling or RabbitMQ-client.
public void timerSchdule()
TimerTask repeatedTask = new TimerTask()
public void run()
System.out.println("performing activity on " + new Date());
;
Timer timer = new Timer("Timer");
long delay = 1000L;
long period = 1000L * 60L * 60L * 24L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
add a comment |
Look into Java timer for scheduling or RabbitMQ-client.
public void timerSchdule()
TimerTask repeatedTask = new TimerTask()
public void run()
System.out.println("performing activity on " + new Date());
;
Timer timer = new Timer("Timer");
long delay = 1000L;
long period = 1000L * 60L * 60L * 24L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
add a comment |
Look into Java timer for scheduling or RabbitMQ-client.
public void timerSchdule()
TimerTask repeatedTask = new TimerTask()
public void run()
System.out.println("performing activity on " + new Date());
;
Timer timer = new Timer("Timer");
long delay = 1000L;
long period = 1000L * 60L * 60L * 24L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
Look into Java timer for scheduling or RabbitMQ-client.
public void timerSchdule()
TimerTask repeatedTask = new TimerTask()
public void run()
System.out.println("performing activity on " + new Date());
;
Timer timer = new Timer("Timer");
long delay = 1000L;
long period = 1000L * 60L * 60L * 24L;
timer.scheduleAtFixedRate(repeatedTask, delay, period);
edited Mar 22 at 18:43
Worthwelle
7011615
7011615
answered Mar 22 at 17:29
Jonathan BaptistJonathan Baptist
1
1
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
add a comment |
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
These are not really repeated tasks. This are individual messages to be sent at specific times independent of each other as defined by a user. I'm actually trying to use my vertx code to send to rabbit-mq queue the messages every 24-hrs and then a spring-boot application (which has a better quartz support), to schedule the messages as per their precise timing. I will update when complete my solution
– Obby
Mar 23 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
You can use the timer and set a cron job , fetch from the db and trigger at the appointed times. anyway i will wait for your update
– Jonathan Baptist
Mar 25 at 13:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047547%2fvertx-io-scheduling-tasks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown