Ubik Batch Server Administration Guide

From UbikWiki

Contents

JVM launcher configuration

For Version < 6.0.0, the server runs with a JDK 5 or JDK6 Ensure you always use the last update of major JDK version:

For Version >= 6.0.0, the server runs with a JDK 6 or JDK 7

Ensure you use the bundle for the right platform (32 bits / 64 bits)

JVM configuration is done in files:

  • setEnv.cfg for Linux/Unix
  • setenv.cmd for Windows

Advised options for the JVM are:

  • -server
  • -XX:MaxPermSize=128M (or above) depending on the number of BARs deployed on the server and their size
  • Tune -Xms and -Xmx depending on the load of your batches and the number of BARs deployed
  • -XX:+HeapDumpOnOutOfMemoryError
  • -XX:HeapDumpPath=<path to logging folder>

Other options:

  • -DLOG_ROOT_PATH=<path to logging folder>

This enables developers to name their logging files relatively to this file using ${LOG_ROOT_PATH}/<bar name>/<what they want>.log

Setting this property enables portable configuration files.

Batch Server General configuration

This configuration is in file <INSTALL_DIRECTORY>/config/config.properties

Common Configuration parameters:

Parameter Description Default Value
CONSOLE_ID Unique ID Of the Batch Server N/A
INSTALL_DIR Folder where server is installed N/A
CONFIG_ROOT Declaration of a variable used later as ${} ${INSTALL_DIR}/ config


PLUGIN_MANAGER_FILE Path to the file that contains general plugin ${CONFIG_ROOT}/plugin-manager.xml
LOCK_DIR Lock folder used only if service

com.saltoconsulting.console.service.LOCKING_SYSTEM is set to com.ubikingenierie.console.locking.impl.FileLockingService, by default Database Locking is used

${INSTALL_DIR}/ LOCK_DIR
COLD_DEPLOYMENT_DIR Folder Batch Server will look into to deploy BARs at startup ${INSTALL_DIR}/ batches-cold-deploy
BAR_UPLOAD_DIRECTORY Folder that will contain BARs transfered from Batch Web Controller,

This folder must only be used by this server and it must be writable

${INSTALL_DIR}/ bar-upload-folder
BAR_UPLOAD_LISTEN_PORT Port on which the Batch server listens for BARs upload N/A
OUTPUT_DATA Folder used temporarily for Mail Generation and Lifecycle state <INSTALL_DIRECTORY> / output
USER_FILE File that hosts JMX Authentication informations
com.salto.console. MAIL_MANAGER_STORE Component used to manage configuraton of Mails, choose between:
  1. salto.batch.system. MailManagerDBStore

=> Saves data in Database(default)

  1. salto.batch.system. MailManagerXMLStore

=> Saves data in XML file

salto.batch.system. MailManagerDBStore
MAIL_FILE Configuration file for Mail Server (MUST BE OK TO SEND MAILS, always used) ${CONFIG_ROOT} / mail.xml
MAIL_MANAGER_FILE File that contains Mails of users to be notified on error,

Used only if com.salto.console.MAIL_MANAGER_STORE=salto.batch.system.MailManagerXMLStore Otherwise informations are stored in Database

${CONFIG_ROOT} / mail-manager.xml
SNMP_FILE File that contains SNMP (Simple network management protocol) configuration. ${CONFIG_ROOT}/snmp.xml
DEVELOPMENT_MODE If true the console start in development mode: FALSE


JVM_MANAGEMENT_CLASS Extended Management implementation that provides live infos about server, to activate it, set its value to:

com.ubikingenierie.console.admin.system.PlatformMXManagementProvider

com.ubikingenierie.console.admin.system.NoopManagementProvider
HIBERNATE_CONFIGURED_DIALECT Force a dialect for Hibernate to override auto detection. For DB2 : com.ubikingenierie.console.persistance.hibernate.DB2ExtendedDialect NA
CLEANUP_DELAY Cleanup delay in days for tables BATCH_HEAD and BATCH_TRT 40
MAIL_SEND_ON_SYSTEM_BATCH_ERROR Send mail on errors of System Batches true

JMX connectivity

Configuration parameters:

Parameter Description
JNDI_NAME JNDI Name that will appear at the end of the JMX URL
JMX_SERVICE_PORT JMX Port that will appear in the URL (It must be free)
NAMING_SERVICE_PORT Naming service Port that will appear in the URL (It must be free)
ACTIVATE_HTTP_ADAPTOR JMX interface that exposes Operations in a Browser (Do not activate in PRODUCTION) false
JMX_HTTP_ADAPTOR_PORT Port of the HTTP JMX adaptor if ACTIVATE_HTTP_ADAPTOR is true

service:jmx:rmi://<HOST OF THE MACHINE>:<JMX_SERVICE_PORT>/jndi/rmi:// <HOST OF THE MACHINE>:<NAMING_SERVICE_PORT>/<JNDI_NAME>


Throttling Configuration

How it works:

Throttling is a feature introduced in 6.1.0 to avoid flooding Alert System with alerts when exceptional event trigger a huge number of errors on batch execution (Database crash...).

If throttling is enabled (THROTTLING_DELAY > 0), each time a batch will be executed a notification can occur in one of those 2 conditions:

  • Number of errors since last nofifications is > 0 and last notification is older than THROTTLING_DELAY
  • Number of errors since last nofifications is > 0 and number of errors for batch is >= to THROTTLING_THRESHOLD

If notification runs as a consequence of a successful batch execution (not related to batch being notified) then no error will be attached to mail, otherwise last error stacktrace will be attached to notification mail.

Configuration parameters:

Parameter Description Default Value
THROTTLING_DELAY Delay in milliseconds between consecutive notifications of errors for one batch.This is to avoid mail overflow when a lot of errors occur in a reduced time interval. To disable set to -1. -1 (DISABLED)
THROTTLING_THRESHOLD Number of errors in a batch execution to trigger notification after first error 10
THROTTLING_CHECK_FREQUENCY Checks for errors are performed after THROTTLING_CHECK_FREQUENCY has passed 60000 (1 minute)

Mailer connectivity

This configuration is referenced by MAIL_FILE property in config.properties (in file <INSTALL_DIRECTORY>/config/mail.xml)

Configuration parameters:

Parameter Description Default Value
mailHost Host of the Mail Server N/A
mailPort Port of the Mail Server 25
useTLS Use TLS for connection to server false
useSSL Use SSL for connection to server false
user Username if mail server requires authentication NA
password Password if mail server requires authentication NA


Mailer Name that will appear in Sent mails N/A

Logging configuration

This configuration is in file <INSTALL_DIRECTORY>/config/log.properties.

Logging is based on Log4j, and this file controls the Server log level. Batch Logging configuration is hosted in each BAR


See http://logging.apache.org/log4j/docs/manual.html

Database connectivity Configuration

JDBC Drivers Configuration (Version < 6.0.0)

Driver libraries must be put in folder:

  • <INSTALL_DIRECTORY>/common/lib

Ensure you always have the last version of the drivers.

JDBC Drivers Configuration (Version >= 6.0.0)

Driver jars must be put in "modules" folder under a group and artifact name.

Example : driver_toto.jar for database titi (company titi).

  • Under "modules" there will be a folder:
    • titi/toto/main which will contain:
      • <driver_toto>.jar
      • module.xml
  • module.xml content will be:
<module xmlns="urn:jboss:module:1.1" name="titi.toto">
    <resources>
           <resource-root path="<driver_toto>.jar"/>
    </resources>
</module>
  • module.xml in folder com/ubikingenierie/consolebatch/main must be edited to add:
<module name="titi.toto" export="true" />

Connections Configuration

This configuration is done in file <INSTALL_DIRECTORY>/config/datasource.xml)

Ubik Batch Server uses Apache commons-dbcp implementation, see:

Note that "jdbc/console" is a mandatory pool for the server to run (poolPreparedStatements must be set to false for it).

Datasource DTD:

<!ELEMENT drivers (ResourceParams*) >
<!ELEMENT ResourceParams (parameter*) >
<!ATTLIST ResourceParams name CDATA #REQUIRED>
<!ELEMENT parameter (name,value)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT value (#PCDATA)>

Example of a pool configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE drivers PUBLIC "-//Salto-consulting //DTD JDBC Datasource Configuration 1.0//EN" 
"http://www.salto-consulting.com/consolebatch/config/datasource.dtd">
<drivers>
<ResourceParams name="jdbc/batchweb">
    <parameter>
      <name>user</name>
      <value>batchweb</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>batchweb</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value><![CDATA[+64wI0/45dIWg1akLg5LMg==]]></value>
    </parameter>
    <parameter>
      <name>isPasswordEncrypted</name>
      <value>true</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>org.postgresql.Driver</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value><![CDATA[jdbc:postgresql://localhost:5432/batchweb]]></value>
    </parameter>
    <parameter>
      <name>validationQuery</name>
      <value><![CDATA[select 1 from dual]]></value>
    </parameter>
    <parameter>
      <name>testOnBorrow</name>
      <value>false</value>
    </parameter>
    <parameter>
      <name>testOnReturn</name>
      <value>false</value>
    </parameter>
    <parameter>
      <name>testWhileIdle</name>
      <value>true</value>
    </parameter>
    <parameter>
      <name>initialSize</name>
      <value>0</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>2000</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>15</value>
    </parameter>
    <parameter>
      <name>minIdle</name>
      <value>1</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>2</value>
    </parameter>
    <parameter>
      <name>timeBetweenEvictionRunsMillis</name>
      <value>300000</value>
    </parameter>
    <parameter>
      <name>numTestsPerEvictionRun</name>
      <value>3</value>
    </parameter>
    <parameter>
      <name>poolPreparedStatements</name>
      <value>true</value>
    </parameter>
    <parameter>
      <name>maxOpenPreparedStatements</name>
      <value>50</value>
    </parameter>
    <parameter>
      <name>connectionProperties</name>
      <value>loglevel=org.postgresql.Driver.DEBUG;allowEncodingChanges=true</value>
    </parameter>
  </ResourceParams>
...
</drivers>

Extension Manager Configuration (MANDATORY FILE)

Configuration file is done in file <INSTALL_DIRECTORY>/config/extension-manager.xml.

An extension register Configuration extension (BatchStarts, their associated JMX and Persistence elements) to the core server. By default the server comes with a mandatory extension, so minimal configuration is:

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
  <extension className="com.ubikingenierie.console.configuration.extension.CoreExension" >
  </extension>
</extensions>

Plugin Manager Configuration (MANDATORY FILE)

A plugin is a class with a start and destroy method. It contains code that must be executed at startup and shutdown of the server.

Configuration file is referenced by property PLUGIN_MANAGER_FILE in config.properties. By default Server comes with 3 mandatory plugins, so minimal configuration is:

<?xml version="1.0" encoding="UTF-8"?>
<!-- #Release @VERSION@ at @DATE@ -->
<plugins>
  <plug-in className="salto.batch.plugin.ServiceInitializationPlugin" id="salto.batch.plugin.ServiceInitializationPlugin">
    <set-property property="initializationOrder" value="-2"></set-property>
	<set-property property="serviceConfigFile" value="<DEPENDS ON YOUR INSTALLATION FOLDER>/config/service-config.properties"></set-property>
  </plug-in>
 
  <plug-in className="com.saltoconsulting.console.monitoring.plugin.HealthMonitorPlugin" id="com.saltoconsulting.console.monitoring.plugin.HealthMonitorPlugin">
    <set-property property="initializationOrder" value="-1"></set-property>
    <set-property property="schedulingPeriod" value="120000"></set-property>
    <set-property property="acceptableBatchDelay" value="120000"></set-property>
  </plug-in>
 
  <plug-in className="salto.batch.system.LockedBatchCheckerPlugin" id="com.saltoconsulting.batch.system.plugin.LockedBatchCheckerPlugin">
    <set-property property="initializationOrder" value="-1"></set-property>
  </plug-in>
</plugins>

Server JMS configuration:

Our server integrates a JNDI connector that integrates in the local JNDI JMS objects from remote JNDIs.

It integrates a process that reconnects to the remote JNDIs during the lifetime of the server.

This enables startup even if remote objects are not yet available.

JMS Object (ConnectionFactories, Topics and Queues) are integrated in the local server JNDI using a configuration file:

  • <BATCH_SERVER_HOME>/config/jms-config.xml


JNDI Objects are composed of:


Element Description
localJndiName Physical name in the local JNDI (must be unique)
type One of:* javax.jms.ConnectionFactory
  • javax.jms.Queue
  • javax.jms.Topic


distantJndiName Physical name in the remote JNDI
env-property Element with 2 children:* name (Name of a JNDI property used to connect to the Remote JNDI)
  • value (Value of the JNDI property used to connect to the Remote JNDI)


env-property/name Name of the property, examples:* java.naming.provider.url
  • java.naming.factory.initial
  • java.naming.factory.url.pkgs
  • ...


env-property/value Value of the property

JMS Config DTD:

<!ELEMENT jndi-objects (jndi-object*) >
<!ELEMENT jndi-object (localJndiName, type, distantJndiName, env-property*) >
<!ELEMENT type (#PCDATA)>
<!ELEMENT localJndiName (#PCDATA)>
<!ELEMENT distantJndiName (#PCDATA)>
<!ELEMENT env-property (name, value) >
<!ELEMENT name (#PCDATA)>
<!ELEMENT value (#PCDATA)>

Example:

<jndi-objects>
  <jndi-object>
    <localJndiName>jms/localConnectionFactoryOJMS</localJndiName>
    <type>javax.jms.ConnectionFactory</type>
    <distantJndiName>demoConnectionFactoryOJMS</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>tcp://localhost:3035/</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>org.exolab.jms.jndi.InitialContextFactory</value>
    </env-property>
  </jndi-object>
...
</jndi-objects>

Note about bindings:

To decouple coding process from deployment, developper should use logical names (start with java:comp/env/jms/localQueue).

To use physical name, just use jms/localQueue.


Deployer can then bind logical to physical names using <BAR_DISPLAY_NAME>-binding.xml, example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bar-resources PUBLIC "-//Ubik-Ingenierie //DTD BAR Binding Resource Configuration 1.0//EN" 
"http://www.ubik-ingenierie.com/consolebatch/config/bar-binding.dtd">
<bar-resources>
<bar-resource nameinbar="jdbc/toto" boundname="jdbc/batchweb" />
<bar-resource nameinbar="jdbc/batchweb" boundname="jdbc/batchweb" />
<bar-resource nameinbar="jms/localConnectionFactory" boundname="jms/localConnectionFactoryOJMS" />
<bar-resource nameinbar="jms/localDemoQueue" boundname="jms/localDemoQueueOJMS" />
</bar-resources>

If developer has used « java:comp/env/jms/localConnectionFactory » in his code, he will in fact use the object jms/localConnectionFactoryOJMS. If he chooses to use physical names (which is not recommended) he will use the name « jms/localConnectionFactoryOJMS». Note that if Batch Server administrator chooses to rename the resource, the code must be modified, while in the first solution, only binding file must be changed.

JMS Brokers:

ActiveMQ

Libraries to add in business/lib folder
  • activemq-core-4.1.1.jar
  • backport-util-concurrent-2.1.jar
JNDI
Attribute Value
java.naming.provider.url tcp://hostname:61616
java.naming.factory.initial org.apache.activemq.jndi.ActiveMQInitialContextFactory
More details
Example
<jndi-object>
    <localJndiName>jms/localConnectionFactoryAMQ</localJndiName>
    <type>javax.jms.ConnectionFactory</type>
    <distantJndiName>demoConnectionFactoryAMQ</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>tcp://hostname:61616</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>org.apache.activemq.jndi.ActiveMQInitialContextFactory</value>
    </env-property>
  </jndi-object>

JORAM

Libraries to add in business/lib folder
  • joram/ship/lib/JCup.jar
  • joram/ship/lib/ow_monolog.jar
  • joram/ship/lib/joram-shared.jar
  • joram/ship/lib/joram-client.jar


JNDI
Attribute Value
java.naming.factory.port 16400
java.naming.factory.host <JORAM Server Host>
java.naming.factory.initial fr.dyade.aaa.jndi2.client.NamingContextFactory
Logging

Ubik Batch Server uses log4j. Joram uses Monolog. Monolog is a wrapper to various logging libraries such as log4j or java.util.logging (logging API included in Java 1.4), so we just have to configure Monolog to use log4j.

  1. Configure Monolog/Joram:
    1. Create an "a3debug.cfg" file with a single line
      log.config.classname org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory
    2. Package this file into a joram-config.jar file in the common/lib directory
  2. Configure Log4J/Ubik Batch Server:
  • Add in the <Batch Server Home>/config/log4j.xml configuration file the line
    <categoryFactory class="org.objectweb.util.monolog.wrapper.log4j.MonologCategoryFactory"/>

Important: You must have a single jar ow_monolog.jar in the server. If a java.lang.ClassCastException is thrown by org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory.getLogger(...), verify the above configuration.

More details
Example
<jndi-object>
    <localJndiName>jms/localConnectionFactoryJORAM</localJndiName>
    <type>javax.jms.ConnectionFactory</type>
    <distantJndiName>demoConnectionFactoryJORAM</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>tcp://hostname:61616</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>org.apache.activemq.jndi.ActiveMQInitialContextFactory</value>
    </env-property>
  </jndi-object>

SonicMQ

Libraries to add in business/lib folder
  • client.jar
  • broker.jar
  • mfcontext.jar
JNDI
Attribute Value
java.naming.provider.url tcp://hostname:2506
java.naming.factory.initial com.sonicsw.jndi.mfcontext.MFContextFactory
More details
Example
<jndi-object>
    <localJndiName>jms/localConnectionFactorySonicMQ</localJndiName>
    <type>javax.jms.ConnectionFactory</type>
    <distantJndiName>demoConnectionFactorySonicMQ</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>tcp://hostname:2506</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>com.sonicsw.jndi.mfcontext.MFContextFactory</value>
    </env-property>
  </jndi-object>

OpenJMS

Libraries to add in business/lib folder
  • openjms-common-0.7.7-beta-1.jar
  • openjms-0.7.7-beta-1.jar
  • openjms-net-0.7.7-beta-1.jar
  • spice-jndikit-1.2.jar (only if embedded JNDI is used)
JNDI
Attribute Value
java.naming.provider.url tcp://localhost:3035/
java.naming.factory.initial org.exolab.jms.jndi.InitialContextFactory
More details
Example
<jndi-object>
    <localJndiName>jms/localConnectionFactoryOJMS</localJndiName>
    <type>javax.jms.ConnectionFactory</type>
    <distantJndiName>demoConnectionFactoryOJMS</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>tcp://localhost:3035/</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>org.exolab.jms.jndi.InitialContextFactory</value>
    </env-property>
  </jndi-object>

MQSeries 6.x

Note

MQSeries does not have an in-house JNDI.

You need to install:

  • support pac ME01 (WebSphere MQ Initial Context),
  • which in turn requires support pac MS0B (MQSeries Java classes for PCF)
Libraries to add in business/lib folder
  • mq-6.0.jar
  • mqjms-6.0.jar
  • mqcontext-6.0.jar
  • mqdhbcore-1.3.1.jar
  • com.ibm.mq.pcf-6.0.3.jar
JNDI
Attribute Value
java.naming.provider.url SERVER_HOST:1431/SYSTEM.DEF.SVRCONN
java.naming.factory.initial com.ibm.mq.jms.context.WMQInitialContextFactory
Example
<jndi-object>
    <localJndiName>jms/QueueMQSeries</localJndiName>
    <type>javax.jms.Queue</type>
    <distantJndiName>TEST.QUEUE</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>sv049002.si3si.int:1431/SYSTEM.DEF.SVRCONN</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>com.ibm.mq.jms.context.WMQInitialContextFactory</value>
    </env-property>
  </jndi-object>

Using SUN FsContext

Libraries to add in business/lib folder
  • providerutil-1.2.jar
  • fscontext-1.2.jar
JNDI
Attribute Value
java.naming.provider.url file://C:\development\ubik\workspace\BrokerRunner\jndi
java.naming.factory.initial com.sun.jndi.fscontext.RefFSContextFactory
Example
<jndi-object>
    <localJndiName>jms/QueueMQSeries</localJndiName>
    <type>javax.jms.Queue</type>
    <distantJndiName>TEST.QUEUE</distantJndiName>
    <env-property>
      <name>java.naming.provider.url</name>
      <value>file://C:\development\ubik\workspace\BrokerRunner\jndi</value>
    </env-property>
    <env-property>
      <name>java.naming.factory.initial</name>
      <value>com.sun.jndi.fscontext.RefFSContextFactory</value>
    </env-property>
  </jndi-object>

Authors

  • Philippe Mouawad

History

  • Page created by Pmouawad, 21 March 2008: New page: == Server JMS configuration: == Our server integrates a JNDI connector that integrates in the local JNDI JMS objects from remote JNDIs. It integrates a process that reconnects to the remo...
  • Contributors: Pmouawad x99, Abourre x2
  • Last modified by Pmouawad, 10 January 2014: /* Connections Configuration */
Personal tools