Amazon Neptune
User Guide (API Version 2017-11-29)

Sharing a Single Gremlin Java Client Instance Across Multiple Threads

Create only one instance of the org.apache.tinkerpop.gremlin.driver.Client class per instance (or group of instances) and share it across multiple threads. That is, only call Client client = Cluster.connect() once rather than do so in each thread.

Note

This also applies to GraphTraversalSource, which creates an internal instance of the Client class. For example, the following code creates a Client instance.

GraphTraversalSource traversal= EmptyGraph.instance().traversal().withRemote(DriverRemoteConnection.using(cluster));