Hi,
I am using lagom for publishing to kafka. I am using JDBC for for persistence. I have deployed two instances for availability. My issue now is that every time a request comes both instances are publishing to kafka. Is there any configuration that i can set in application.conf which will prevents this.
Below is my loader and application.conf file
class TweedLoader extends LagomApplicationLoader {
override def load(context: LagomApplicationContext): LagomApplication =
new TweedApplication(context) with ConfigurationServiceLocatorComponents
override def describeService = Some(readDescriptor[TweedService])
}
abstract class TweedApplication(context: LagomApplicationContext)
extends LagomApplication(context)
with JdbcPersistenceComponents
with HikariCPComponents
with LagomKafkaComponents
with AhcWSComponents {
override lazy val lagomServer: LagomServer = serverFor[TweedService](wire[TweedServiceImpl])
lazy val appsImpl: AppsImpl = wire[AppsImpl]
override def jsonSerializerRegistry: JsonSerializerRegistry = NotificationSerializerRegistry
val cs = clusterSharding.init(
Entity(NotificationState.typeKey)(
entityContext => NotificationBehavior.create(entityContext)
)
)
}
play.application.loader = com.tweed.impl.TweedLoader
play.http.secret.key="QCY?tAnfk?aZ?iwrNwnxIlR6CTf:G3gf:90Latabg@5241AB`R5W:1uDFN];Ik@n"
akka.discovery.method=config
lagom.cluster.bootstrap.enabled = false
lagom.cluster.join-self = true
akka.cluster.min-nr-of-members = 1
lagom.circuit-breaker {
default.enabled = on
default.call-timeout = 50s
default.reset-timeout = 15s
default.max-failures = 5
}
lagom.broker.kafka {
service-name =""
brokers = "kafkahost:9092"
}
db.default {
driver = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://mysqlhost/sample_db?charset=utf8&parseTime=True"
username = "user"
password = "password"
async-executor {
queueSize = 10000
numThreads = 20
minConnections = 20
maxConnections = 20
}
hikaricp {
minimumIdle = ${db.default.async-executor.minConnections}
maximumPoolSize = ${db.default.async-executor.maxConnections}
}
}
jdbc-defaults.slick {
profile = "slick.jdbc.MySQLProfile$"
jndiName = DefaultDS
}