Scylla Documentation Logo Documentation
  • Server
    • Scylla Open Source
    • Scylla Enterprise
    • Scylla Alternator
  • Cloud
    • Scylla Cloud
    • Scylla Cloud Docs
  • Tools
    • Scylla Manager
    • Scylla Monitoring Stack
    • Scylla Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
Download
Menu

Caution

You're viewing documentation for a previous version of Scylla Java Driver. Switch to the latest stable version.

Scylla Java Driver Manual Using the shaded JAR

Using the shaded JAR¶

The default driver JAR depends on Netty, which is used internally for networking.

This explicit dependency can be a problem if your application already uses another Netty version. To avoid conflicts, we provide a “shaded” version of the JAR, which bundles the Netty classes under a different package name:

<dependency>
  <groupId>com.scylladb</groupId>
  <artifactId>scylla-driver-core</artifactId>
  <version>3.11.2.0</version>
  <classifier>shaded</classifier>
  <!-- Because the shaded JAR uses the original POM, you still need
       to exclude this dependency explicitly: -->
  <exclusions>
    <exclusion>
      <groupId>io.netty</groupId>
      <artifactId>*</artifactId>
    </exclusion>
  </exclusions>
</dependency>

If you also use the mapper, you need to remove its dependency to the non-shaded JAR:

<dependency>
  <groupId>com.scylladb</groupId>
  <artifactId>scylla-driver-core</artifactId>
  <version>3.11.2.0</version>
  <classifier>shaded</classifier>
  <exclusions>
    <exclusion>
      <groupId>io.netty</groupId>
      <artifactId>*</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.scylladb</groupId>
  <artifactId>scylla-driver-mapping</artifactId>
  <version>3.11.2.0</version>
  <exclusions>
    <exclusion>
      <groupId>com.scylladb</groupId>
      <artifactId>scylla-driver-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Limitations¶

When using the shaded jar, it is not possible to configure the Netty layer.

Extending NettyOptions is not an option because NettyOptions API exposes Netty classes, and as such it should only be extended by clients using the non-shaded version of driver. Attempting to extend NettyOptions with shaded Netty classes is not supported, and in particular for OSGi applications, it is likely that such a configuration would lead to compile and/or runtime errors.

Also, with shaded Netty classes, it is not possible to benefit from Netty native transports.

It is therefore normal to see the following log line when the driver starts and detects that shaded Netty classes are being used:

Detected shaded Netty classes in the classpath; native epoll transport will not work properly, defaulting to NIO.
PREVIOUS
Retries
NEXT
Socket options
  • 3.11.2.x
    • 4.13.0.x
    • 4.12.0.x
    • 4.11.1.x
    • 4.10.0.x
    • 4.7.2.x
    • 3.11.2.x
    • 3.11.0.x
    • 3.10.2.x
    • 3.7.2.x
  • Scylla Java Driver for Scylla and Apache Cassandra®
  • API Documentation
  • Manual
    • Address resolution
    • Asynchronous programming
    • Authentication
    • Compression
    • Control connection
    • Custom Codecs
    • Custom Payloads
    • Query idempotence
    • Load balancing
    • Logging
    • Metadata
    • Metrics
    • Native protocol
    • Object Mapper
      • Definition of mapped classes
      • Using custom codecs
      • Using the mapper
    • OSGi
    • Paging
    • Connection pooling
    • Query timestamps
    • Reconnection
    • Retries
    • Using the shaded JAR
    • Socket options
    • Speculative query execution
    • SSL
    • Statements
      • Simple statements
      • Prepared statements
      • Built statements
      • Batch statements
    • Using Tuples with the Java driver
    • User-defined types
  • Upgrade guide
    • Migrating from Astyanax
      • Configuration
      • Language change : from Thrift to CQL
      • Queries and Results
  • Frequently Asked Questions
  • Changelog
  • Create an issue
  • Edit this page

On this page

  • Using the shaded JAR
    • Limitations
Logo
Docs Contact Us About Us
Mail List Icon Slack Icon
© 2022, ScyllaDB. All rights reserved.
Last updated on 25 May 2022.
Powered by Sphinx 4.3.2 & ScyllaDB Theme 1.2.2