I'm digging into a project that uses camel routes with quartz scheduler. I'm a little unfamiliar with the environment, but trying to figure out what's happening and how everything fits together, while trying to make a change in functionality. Just not sure how.
The component is a job manager deployed to Apache Karaf. If I have schedule (quartz cron) for a job that is active, then the job runs when the cron string is matched. The schedule can be disabled (which sets toggles autoStartup flag from what I can tell). This is working as expected.
If I disable a schedule, wait for a match on the cron string, and then reenable the schedule, the job runs. I'd like to change this behaviour, configuring schedules to only execute for cron strings that are matched while the schedule is active, and not "catch up" with matches from the disabled autostartup. Is this possible?
I see a similar question was asked last October, but never answered - Camel Quartz route undesired job execution at route startup
On Quartz trigger there is MisfireInstruction property which can be set to MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY (which equals to -1)
Unfortunately, I don't known how to set this from Camel Quartz component. Adding something like trigger.misfireInstruction=-1 or trigger.MisfireInstruction=-1 might work.
Related
I'm struggling to get Liquibase and Camel to work seamlessly.
It happens that Camel initiates its routes before Liquibase applies its patches, leading to an error if the former has to access a table that is not in the database yet.
As a workaround, I've put in a delayed thread the start of the routes. It works, but not in every case: e.g. Weld does not propagate context in new threads, so I cannot do anything complicated in them.
Is there a way to delay Camel start or anticipate the time Liquibase applies its patches?
Set autoStartup=false for your camel routes and start the routes once after liquibase patches up the database. You may use a timer or the value of LOCKED flag set on liquibase generated table 'databasechangeloglock' to check if liquibase is patching or not based on your use case.
Can anybody explain me why "Configuration" section of running job in Apache Flink Dashboard is empty?
How to use this job configuration in my flow? Seems like this is not described in documentation.
The configuration tab of a running job shows the values of the ExecutionConfig. Depending on the version of Flink you might will experience a different behaviour.
Flink <= 1.0
The ExecutionConfig is only accessible for finished jobs. For running jobs, it is not possible to access it. Once the job has finished or has been stopped/cancelled, you should be able to see the ExecutionConfig.
Flink > 1.0
The ExecutionConfig can also be accessed for running jobs.
I have a simple question that I can't find information on regarding Apache Camel-Quartz. For Camel-Quartz to work do you have to deploy inside a web container like Tomcat? And hence because the application will always be alive it will know when to run?
I'm asking because if you deploy your Camel application in a stand alone JVM I don't see how the application will be smart enough to understand when to run.
thanks
Quartz is embedded with your Camel application and thus when you start Camel, quartz is also started. And then it knows when to run, as long you keep the Camel application running.
There is no magic in there. Its just java code that runs, and Quartz is also just java code. And it does not require a special server etc. Quartz is just a library (some JAR files) that you run together with your own application.
Quartz just have logic for scheduling jobs (eg its like a big clock-work) that knows what the time is, and when to trigger jobs accordingly to how you tell it to.
When submitting a task from an version, the task ends up in different version for execution. How do I make the task executing in the same deploying version?
Note:
I tried 'target' in queue.xml, the result is the same. Tasks will be executed in random different version. It is not always the same.
What's wrong with my setup?
[UPDATE]
<queue>
<name>shopinionMessage</name>
<rate>10/s</rate>
<retry-parameters>
<task-retry-limit>60</task-retry-limit>
<min-backoff-seconds>1</min-backoff-seconds>
<max-backoff-seconds>30</max-backoff-seconds>
<max-doublings>0</max-doublings>
</retry-parameters>
<target>2</target>
</queue>
https://developers.google.com/appengine/docs/java/config/queue#target says that target is
A string naming a module/version, a frontend version, or a backend, on which to execute this task.
Do you have modules perhaps? If yes, you should try my-version.my-module as target; unfortunately you won't have any luck with that either as of now: https://code.google.com/p/googleappengine/issues/detail?id=10954
By the way, without a target it shouldn't be random regarding where the task is executed:
If target is unspecified, then tasks are invoked on the same version of the application where they were enqueued. So, if you enqueued a task from the default application version without specifying a target on the queue, the task is invoked in the default application version. Note that if the default application version changes between the time that the task is enqueued and the time that it executes, then the task will run in the new default version.
Recently I've started using limited staging on my Google App Engine project. The data is still shared between all versions, but behaviour (especially user facing behaviour) is different.
Naturally when I implement something incredibly new it only runs on the latest version of my code and I don't feel like it should be backported to the older versions.
Some of this new functionality requires cron jobs to be run periodically, but I'm hitting a problem. I have to run a cron job to call the latest code, but this is what Google's documentation has to say about the issue:
Cron requests are always sent to the default version of the application.
The default version is the oldest because the first versions of the client code that went out to users weren't future proof and don't know how to select which API version to call.
So my question is, how can I get around this limitation and make a cron job that will call the latest rather than the default version of the application?
You can now specify a version using the target tag.
<target>version-2</target>
You can't change the cron jobs to run on a different version then the default.
Depending on how much time your cron job takes to run you could change your cron job script to to do a URLFetch to "http://latest.appname.appspot.com/cron_job_endpoint".
If you're cron job takes longer then 10 minutes to run, then I would design it in a way that you can chain the different tasks using task queues.