0

I have an existing application which uses Apache Cassandra, and I am attempting to check its compatibility with Azure Cosmos DB for Apache Cassandra

My application uses a recent 4.x version of the DataStax Java Driver for Cassandra (this has subsequently been adopted by Apache themselves).

To eliminate my app from the equation, I took the sample from here and tried it - then updated it to the newest driver and tried again:

https://github.com/Azure-Samples/azure-cosmos-db-cassandra-java-getting-started-v4/tree/master

No matter what I do, this is the error I get:

com.datastax.oss.driver.internal.core.protocol.FrameDecodingException: Error decoding frame for streamId 21584
        at com.datastax.oss.driver.internal.core.protocol.FrameDecoder.decode(FrameDecoder.java:108)
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:333)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1519)

...

Caused by: com.datastax.oss.driver.api.core.connection.FrameTooLongException: Adjusted frame length exceeds 268435456: 825110825 - discarded
[s0] Error connecting to Node(endPoint=xxxx.documents.azure.com/xxx:443, hostId=null, hashCode=1e66f887), trying next node 

Has anyone got Java code working against Cosmos using the Cassandra wire protocol?

1 Answer 1

0

As it turns out, Microsoft's own tutorial (at least the way I read it) tells you to do this to get your contact points:

az cosmosdb show --resource-group "xxx" --name "yyyy"  --query "{username:name,contactPoint:documentEndpoint}"

This produces:

{
  "contactPoint": "https://yyyy.documents.azure.com:443/",
  "username": "yyyy"
}

However, digging further into Microsoft's own tutorial confirms the port should be 10350 and the Azure Console (not the tutorial, anywhere!) says the hostname should be:

yyyy.cassandra.cosmos.azure.com

And then it all starts working.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.