2

enter image description here

Trying to connect Apache James with AWS Keyspaces. James is able to connect but, failing with the above error after few seconds.

enter image description here

According to the stack trace the exception is thrown from the above method.

Any help is appreciated. Thank you,

Jishnu S
  • 71
  • 7

1 Answers1

2

As error message shows, the now function isn't supported by Amazon Keyspaces, so James won't work out of box without modification. You can try to change that function to something like this (see doc for QueryBuilder):

return session.prepare(select()
         .all()
         .from("local"))
         .bind();

and rebuild. But most probably, it will fail in some other place.

P.S. Really, there are plenty of differences from OSS Cassandra, so a lot of code may not work.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Yes. I tried the same. got another error. =============== 13:22:11.850 [cluster7-nio-worker-3] DEBUG com.datastax.driver.core.QueryLogger.ERROR - [cluster7] [15.222.43.132/15.222.43.132:9142] Query error after 1 ms: SELECT count(*) FROM keyspaces WHERE keyspace_name=?; com.datastax.driver.core.exceptions.InvalidQueryException: countRows is not yet supported. at com.datastax.driver.core.Responses$Error.asException(Responses.java:181) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:651) – Jishnu S Dec 13 '21 at 13:56
  • So Apache James does not support AWS Keyspaces out of the box ?. – Jishnu S Dec 13 '21 at 13:57
  • I doubt that it will work without heavy tuning – Alex Ott Dec 13 '21 at 14:18
  • Could anyone translate this to cql query. select() .fcall("NOW") .from("local")) .bind(); – Jishnu S Dec 15 '21 at 04:19
  • 1
    It’s select now() from local; – Alex Ott Dec 15 '21 at 06:09
  • You can execute this in keyspaces by executing the following "SELECT CAST(now() AS timeuuid) FROM local" – MikeJPR May 11 '22 at 17:03