From 6867165860ade108b47006f923f765c0c241ced6 Mon Sep 17 00:00:00 2001 From: Petar Bozin Date: Mon, 16 Jan 2017 11:29:32 +0100 Subject: [PATCH] Updated ObpJvmMappedConnector to reflect changes in OBP-JVM version 2016.11-RC6-SNAPSHOT --- pom.xml | 2 +- .../ObpJvmMappedConnector.scala | 25 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 86cf8130d..22bc1573a 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 2.11.8 2.4.10 2.6.3 - 2016.11-RC5-SNAPSHOT + 2016.11-RC6-SNAPSHOT UTF-8 ${project.build.sourceEncoding} diff --git a/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala b/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala index 795897fdc..e691b7c51 100644 --- a/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala +++ b/src/main/scala/code/bankconnectors/ObpJvmMappedConnector.scala @@ -25,7 +25,7 @@ import code.transactionrequests.MappedTransactionRequest import code.transactionrequests.TransactionRequests._ import code.util.{Helper, TTLCache} import code.views.Views -import com.tesobe.obp.kafka.SimpleNorth +import com.tesobe.obp.kafka.{Configuration, SimpleConfiguration, SimpleNorth} import com.tesobe.obp.transport.{Pager, Transport} import net.liftweb.common._ import net.liftweb.mapper._ @@ -53,21 +53,18 @@ object ObpJvmMappedConnector extends Connector with Loggable { var jvmNorth : JConnector = null - val producerProps : JHashMap = new JHashMap - val consumerProps : JHashMap = new JHashMap + val cfg: Configuration = new SimpleConfiguration( + this, + Props.get("kafka.host").openOr("localhost:9092"), // responseProps + Props.get("kafka.response_topic").openOr("Response"), // responseTopic + Props.get("kafka.host").openOr("localhost:9092"), // requestProps + Props.get("kafka.request_topic").openOr("Request") // requestTopic + ) - consumerProps.put("bootstrap.servers", - Props.get("kafka.host").openOr("localhost:9092")) - producerProps.put("bootstrap.servers", - Props.get("kafka.host").openOr("localhost:9092")) - - val factory = Transport.factory(Transport.Version.Nov2016, Transport.Encoding.json).get - val north = new SimpleNorth( - Props.get("kafka.response_topic").openOr("Response"), - Props.get("kafka.request_topic").openOr("Request"), - consumerProps, producerProps) - jvmNorth = factory.connector(north) + val north = new SimpleNorth( cfg ) + jvmNorth = Transport.defaultFactory.connector(north) north.receive() // start ObpJvm + logger.info(s"ObpJvmMappedConnector running") // Local TTL Cache