Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jakartabatch-dev] Proposal: give more control over jobcontroller queue(s)

In the project I'm working on, I'd like to have separate queues for my jobs. Some jobs should be limited to 1 concurrent, and others max 2, while even other jobs should not have a limit other than the available thread pool.

I'd love that this would be possible to configure in code, at least which jobs end up in which queue. E.G.

<job name="fooJob" queue="file-read">
    <...>
</job>

and in Java:

@Job(queue="file-read")
@Named
public class FooJob extends AbstractJob {
    ...
}

Currently there is no Java peer to the <job> JSL part.

As for configuring the JobController from your application, that is something I haven't thought about *that* hard, I have no experience with running multiple applications that all run jobs on one appserver. However, how the job controller works internally with multiple deployments, is something we all can figure out I guess.

For the configuration part inside a deployment, a CDI qualifier should do the trick:

@JobControllerConfiguration({@JobQueue(name="file-read", maxConcurrency=1, maxQueueLength=10), @JobQueue(name="banana")}
public class MyAppsJobControllerConfiguration {
}

or a specific JSL:

<jobcontroller>
    <queues>
        <queue name="file-read" maxConcurrency="1" maxQueueLength="1" />
        <...>
    </queues>
</jobcontroller>

Martijn


Back to the top