0

I start my first Lagom example via this command:

activator new my-first-system lagom-java

When I tried to start this project I noticed that I have an embedded Casandra started.

So I tried to disable this one to connect to my external Cassandra instance. To do that I used:

lagomCassandraEnabled in ThisBuild := false
lagomUnmanagedServices in ThisBuild := Map("cas_native" -> "http://ip:9042")

With this configuration, I succeed to connect to my Cassandra instance, but even that I still have a kind of heaviness in my build.

So I want to know by disabling Lagom Cassandra:

  1. it will be started but it will be not used? or
  2. it will be not downloaded So it will be not started?

Any help, please

Imen
  • 161
  • 2
  • 14

1 Answers1

2

Cassandra will not be started when lagomCassandraEnabled in ThisBuild := false, regarding the download using Maven or Ivy will cache the libraries locally in your desktop, so probably the first build will more time but after the consecutive builds should be faster.

https://www.lagomframework.com/documentation/1.3.x/java/CassandraServer.html

You should not see the message:

[info] Starting Cassandra and [info] Cassandra server running at 127.0.0.1:4000 in the log...

To check detailed activity of Cassandra you can configure the logging

https://www.lagomframework.com/documentation/1.3.x/java/SettingsLogger.html

with: <logger name="org.apache.cassandra" level="ALL" /> <logger name="com.datastax.driver" level="ALL" />

  • I'm not using any Cassandra dependency in my project and I still have some Cassandra logs. Why Lagom start Cassandra even my modules did not use or connect to Cassandra ? ==============================> [info] Starting Cassandra .................................... [info] Cassandra server is not yet started. [info] [info] The value assigned to [info] `lagomCassandraMaxBootWaitingTime` [info] is either too short, or this may indicate another [info] process is already running on port 4000 – Imen Dec 07 '17 at 09:39
  • The Lagom development environment starts Cassandra by default, regardless of whether or not you have projects that depend on it. – Tim Moore Dec 11 '17 at 03:48
  • You may check in the application loader like ```abstract class AuthenticationApplication(context: LagomApplicationContext) extends LagomApplication(context) with CassandraPersistenceComponents with LagomKafkaComponents with AhcWSComponents {```, importing `CassandraPersistenceComponents` normally will implicitly import the cassandra depedencies... – Fernando Hackbart Dec 15 '17 at 14:40