JMeter Bolt Protocol
Learn how to use Apache JMeter's Bolt sampler to execute Cypher queries against Neo4j databases for performance testing graph database procedures.
Mark
Performance Testing Expert
Apache JMeter version 5.2 introduced the Bolt sampler, enabling users to execute Cypher queries via the Bolt protocol. This functionality proves particularly valuable for testing Neo4j procedures.
Key Components
The Bolt implementation in JMeter consists of two primary elements:
1. Bolt Connection Configuration
This component handles database connectivity details:
| Setting | Example Value |
|---|---|
| Name | Bolt Connection Configuration |
| URI | bolt://localhost:7687 |
| Username | neo4j |
| Password | (your password) |
2. Bolt Request
This section accepts Cypher statements and optional parameters formatted in JSON. Parameters remain optional but support dynamic query values when needed.
Example Cypher Statements
Data Insertion
CREATE (ee:Person { name: "Emil", from: "Sweden", klout: 99 })
Data Retrieval
MATCH (ee:Person) WHERE ee.name = "Emil" RETURN ee;
Parameterized Query
With parameters {"personName": "Emil"}:
MATCH (ee:Person) WHERE ee.name = $personName RETURN ee;
Use Cases
- Performance testing Neo4j stored procedures
- Load testing graph database queries
- Benchmarking Cypher query performance
- Testing graph traversal operations under load
Further Reading
Tags: