4.4.2 Configuring Kafka

Perform the following procedure to configure Kafka:

  1. Create the datasource for ILP context in Tomcat by editing the server.xml file in the <TOMCAT_HOME_DIR>/conf directory.

    Note:

    The following example is a sample configuration. Update your database details accordingly. Make sure the context name matches the directory name under webapps. In the following example, ILP is the context name.
    <Context path="/ILP" docBase="/scratch/ofsaobie/apache-tomcat- 8.0.21/webapps/ILP" debug="0" reloadable="false" crossContext="true">
    <Loader delegate="true"/>
    <Resource auth="Container"
    name="jdbc/FICMASTER" type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver" username="act_obiconf"
    password="password" url="jdbc:oracle:thin:@whf00aqr:1521/DEVUT08SPRINT" maxTotal="100"
    maxIdle="30"
    maxWaitMillis="10000" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/>
    <Resource auth="Container"
    name="jdbc/OFSAAAIINFO" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" username="act_obiatm"
    password="password" url="jdbc:oracle:thin:@whf00aqr:1521/DEVUT08SPRINT" maxTotal="100"
    maxIdle="30"
    maxWaitMillis="10000" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/>
    <Resource auth="Container"
    name="jdbc/OFSAAAIINFOCNF" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" username="act_obiatm"
    password="password" url="jdbc:oracle:thin:@whf00aqr:1521/DEVUT08SPRINT" maxTotal="100"
    maxIdle="30"
    maxWaitMillis="10000" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/>
    
    </Context>
    
    
  2. Update the following parameters in the install.properties file in the fichome/realtime_processing/conf directory:
    sql.config.datasource.jndi.name=java:comp/env/jdbc/FICMASTER sql.atomic.datasource.jndi.name=java:comp/env/jdbc/<RTI_INFODOM> sql.metadom.datasource.jndi.name=java:comp/env/jdbc/<RTI_INFODOM>CNF

    Note:

    Name should match the Resource Name defined in the server.xml file.
  3. Update the $TOMCAT_HOME/webapps/ILP/conf/install.properties file for kafka broker details, the inbound topic names, and outbound topic names as shown in the following example:
    kafka.bootstrap-servers=whf00act.in.oracle.com:9092 kafka.inbound.topic.group.id=IPE kafka.inbound.topic=IPERT.t kafka.outbound.topic=IPERESPONSE.t kafka.consumer.num=5 kafka.inbound.partitions=10 kafka.inbound.poll.timeout=3000
  4. Update the application-env.properties file in $TOMCAT_HOME/webapps/ILP/conf directory after commenting out the parameter
    spring.profiles.active=JMS,JMSApplicationCache,JMSGateway,JMSFeedBackGa teway
    and adding
    spring.profiles.active=IPEKAFKA

    Note:

    The preceding example changes will remove the JMS dependencies for IPE and enable Kafka.
  5. Update the web.xml file in the $TOMCAT_HOME/webapps/ILP/WEB-INF directory (append the ,/conf/applicationContext-kafka.xml file in the end under param contextConfigLocation).
    /conf/applicationContext.xml,/conf/applicationContext- jms.xml,/conf/applicationContext- jmx.xml,/conf/ext/spring*.xml,/conf/applicationContext-kafka.xml
  6. Copy the following jars from the fichome/realtime_processing/additionaljars directory to the fichome/realtime_processing/WEB-INF/lib directory:
    1. spring-messaging-4.2.3.RELEASE.jar
    2. spring-kafka-1.2.0.RELEASE.jar
    3. spring-integration-kafka-2.0.1.RELEASE.jar
    4. kafka-clients-0.11.0.0.jar
    5. slf4j-log4j12-1.4.3.jar
    6. slf4j-api-1.4.3.jar
    7. jms-api-1.1-rev-1.jar
    8. javax.ws.rs-api-2.0.1.jar
  7. Update the following in the server.properties file under config directory:
    num.partitions=200 auto.create.topics.enable=true
  8. Execute the ant.sh script to create ilp.ear and ilp.war files from the fichome/realtime_processing directory.
  9. Copy the ilp.war file to the TOMCAT_HOME/webapps directory.
  10. Restart the Tomcat server to deploy ilp.war.