Getting Started
Yupiik Batch provides an UI which can be used to visualize a database populated using ExecutionTracer
.
Dependency
The dependency to use is:
<dependency>
<groupId>io.yupiik.batch</groupId>
<artifactId>yupiik-batch-ui-backend</artifactId>
<version>${yupiik-batch.version}</version>
</dependency>
You can add any JDBC driver you want too. Once you have it, you can create a Docker image using the main org.apache.openwebbeans.se.CDILauncher
- just use the previous classpath.
TIP
|
using |
Configuration
Name | Env Variable | Description |
---|---|---|
|
|
Job table to query. |
|
|
Step table to query. |
|
|
Datasource driver. |
|
|
Max connections in the pool. |
|
|
How long to await before a connection is considered idled and evictable. |
|
|
Min connections in the pool. |
|
|
Datasource password. |
|
|
Should connections be removed when abandoned (see related timeout). |
|
|
The time in seconds before a connection can be considered abandoned. |
|
|
Should connections be tested on borrow time. |
|
|
Should connections be tested on return to the pool time. |
|
|
Should connections be tested in background. |
|
|
Time between background evictions in ms. |
|
|
Datasource URL. |
|
|
Datasource username. |
|
|
Validation query to validate the connection when enabled. |
|
|
How long to await for the validation query. |
|
|
Count all jobs SQL query (for portability), `${table}` is replaced by the table name. |
|
|
Find all jobs with pagination SQL query (for portability), `${table}` is replaced by the table name. Parameters can be `${pageSize}`, `${firstIndex}` - inclusive, `${lastIndex}` - exclusive, or `${where}` which would be replaced by a name where clause (`WHERE name = ? `). |
|
|
Find a job by id SQL query (for portability), `${table}` is replaced by the table name. |
|
|
SQL query (for portability) to find last execution of each batch, `${table}` is replaced by the table name. |
|
|
Find aall steps related to a job id SQL query (for portability), `${table}` is replaced by the step table name. |
|
|
Tomcat access log pattern. |
|
|
Tomcat port. |
|
|
List of allowed users - by default all are. It uses a properties syntax: `user=password`. Security uses a web BASIC mecanism. |
|
|
Javascript path to a Yupiik Batch frontend extension. Script is injected just before yupiik-batch main one, i.e. after libraries ones but note they are minified wih webpack. |
Extend the UI
The UI provides a few extension points to let you enrich it with other utilities.
First step is to create a javascript file which will register the extension then use the related configuration to let the server inject it into the index.html
.
An extension often looks like:
window.yupiikBatchExtensions = (function () {
return {
routes: function (React, router, antd, antdIcons) { // custom additional routes
var e = React.createElement;
// foo extension (content + breadcrumb)
function Foo() {
return e(router.Link, { to: '/extensions/foo' }, ['Foo link']);
}
function FooBreadcrumb() {
return e(antd.Breadcrumb, null, [
e(antd.Breadcrumb.Item, null, [
e(router.Link, { to: '/' }, [
e(antdIcons.HomeOutlined, null, null),
]),
]),
e(antd.Breadcrumb.Item, null, [
e('span', null, ['Files']),
]),
]);
}
Foo.Breadcrumb = vBreadcrumb;
// register extension routes
return [
{
path: '/extensions/foo',
component: Foo,
sider: {
selectedKey: 'foo',
menu: {
attributes: {
icon: e(antdIcons.FileOutlined, null, null),
},
content: e(router.Link, { to: '/extensions/foo' }, 'Foo'),
},
},
},
];
},
// wrap comments - if you want to match a pattern to add links or components
commentWrapper: function (comment, React, router, antd, antdIcons) {
return `THIS IS A COMMENT: ${comment}`;
},
// enables to overwrite parts of the routes
routeDecorator: function (route) { return route; },
// enables to change the columns of the tables, method is the JSON-RPC methods called for the table
tableColumnsWrapper: function ({ columns, method }) {
return columns;
},
// enables to add headers into your fetchJsonRPC calls
fetchJsonRpcHeaders: function() {
return {
'header1':'value',
'header2':'value',
}
},
// Enables to wrap the Yupiik Batch App in high order component, for logging or else
// React and antd must be passed to the components (library import will not work)
bootstrap: function ({ ReactDOM, React , App, antd }) {
ReactDOM.render(
<React.StrictMode>
<ExampleWrapper app={App} />
</React.StrictMode>,
document.getElementById('root')
);
},
};
})();
TIP
|
|