question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation not explaining how to obtain the CqlSession object (for Cassandra integration)

See original GitHub issue

Thanks for this great project. I’m successfully using it with PostgreSQL already. 👍

However, I don’t get it to work with Cassandra, because I can not obtain the needed CqlSession object.

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.datastax.oss.driver.api.core.CqlSession' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

The minimal example in the docs does not state how to get it.

@Bean
public CassandraLockProvider lockProvider(CqlSession cqlSession) {
    return new CassandraLockProvider(cqlSession);
}

Here is a full minimal example (using Kotlin) to reproduce the issue: https://gist.github.com/Dobiasd/ac1429ad403c5480ea05fb11f9a53959

It would be cool if we documentation could be extended such that it explains how to get the CqlSession.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
snicollcommented, May 4, 2020

Obtaining the CqlSession in a project using spring-boot-starter-data-cassandra seems to be non-trivial

If you’re using the proper Spring Boot version, it should be. I’ve commented your SO question.

0reactions
Dobiasdcommented, May 4, 2020

Thanks, that should suffice to save some time for future users like me. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataStax Java Driver - Core driver
CqlSession is the main entry point of the driver. It holds the known state of the actual Cassandra cluster, and is what you...
Read more >
Using the Cassandra Client - Quarkus
This quickstart guide shows how to build a REST application using the Cassandra Quarkus extension, which allows you to connect to an Apache...
Read more >
A Guide to Cassandra with Java - Baeldung
This tutorial is an introductory guide to the Apache Cassandra database using Java. You will find key concepts explained, along with a ...
Read more >
Spring Data for Apache Cassandra - Reference Documentation
It explains Cassandra module concepts and semantics and the syntax for various ... CqlSession object by using the Spring IoC container.
Read more >
cassandra-migration/README.md at master_v4 - GitHub
As the Cluster class has been removed by Datastax you have to pass a CqlSession instance into the Database object. You should not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found