![]() |
VOOZH | about |
dotnet add package Elastic.Transport.VirtualizedCluster --version 1.0.0
NuGet\Install-Package Elastic.Transport.VirtualizedCluster -Version 1.0.0
<PackageReference Include="Elastic.Transport.VirtualizedCluster" Version="1.0.0" />
<PackageVersion Include="Elastic.Transport.VirtualizedCluster" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="Elastic.Transport.VirtualizedCluster" />Project file
paket add Elastic.Transport.VirtualizedCluster --version 1.0.0
#r "nuget: Elastic.Transport.VirtualizedCluster, 1.0.0"
#:package Elastic.Transport.VirtualizedCluster@1.0.0
#addin nuget:?package=Elastic.Transport.VirtualizedCluster&version=1.0.0Install as a Cake Addin
#tool nuget:?package=Elastic.Transport.VirtualizedCluster&version=1.0.0Install as a Cake Tool
An in-memory virtual cluster for testing Elastic.Transport behavior without connecting to a real cluster. Provides a fluent rule engine to simulate ping, sniff, and API call responses, and an auditor to assert the exact sequence of transport actions.
dotnet add package Elastic.Transport.VirtualizedCluster
// Bootstrap a 3-node virtual cluster
var cluster = Virtual.Elasticsearch
.Bootstrap(3)
.ClientCalls(r => r.SucceedAlways())
.StaticNodePool()
.AllDefaults();
var response = cluster.ClientCall();
// response.ApiCallDetails.HttpStatusCode == 200
Rules control how the virtual cluster responds to pings, sniffs, and client API calls.
Virtual.Elasticsearch
.Bootstrap(3)
.ClientCalls(r => r.SucceedAlways())
// or fail a certain number of times, then succeed
.ClientCalls(r => r.Fails(TimesHelper.Times(2)).Succeeds(TimesHelper.Times(10)))
// simulate slow responses
.ClientCalls(r => r.Takes(TimeSpan.FromSeconds(10)).SucceedAlways())
// return a custom response body
.ClientCalls(r => r.ReturnResponse(new { hits = new { total = 100 } }).SucceedAlways())
.StaticNodePool()
.AllDefaults();
Virtual.Elasticsearch
.Bootstrap(3)
.Ping(r => r.SucceedAlways())
// or fail on a specific port
.Ping(r => r.OnPort(9201).Fails(TimesHelper.Times(1)))
.Ping(r => r.OnPort(9202).SucceedAlways())
.StaticNodePool()
.AllDefaults();
Virtual.Elasticsearch
.Bootstrap(3)
.Sniff(r => r.SucceedAlways())
// or return a new cluster topology after sniffing
.Sniff(r => r.Succeeds(TimesHelper.Always, Virtual.Elasticsearch.Bootstrap(5)))
.SniffingNodePool()
.AllDefaults();
Choose the node pool to test different failover and discovery behaviors:
var cluster = Virtual.Elasticsearch.Bootstrap(10);
cluster.StaticNodePool() // Fixed list of nodes
cluster.SniffingNodePool() // Discovers nodes via sniff API
cluster.StickyNodePool() // Prefers a single node
cluster.StickySniffingNodePool() // Sticky with sniff discovery
cluster.SingleNodeConnection() // Single node, no failover
The Auditor class asserts the exact sequence of transport events across both sync and async code paths:
var auditor = new Auditor(() => Virtual.Elasticsearch
.Bootstrap(3)
.Ping(r => r.SucceedAlways())
.ClientCalls(r => r.SucceedAlways())
.StaticNodePool()
.AllDefaults()
);
await auditor.TraceCall(new ClientCall
{
{ AuditEvent.PingSuccess, 9200 },
{ AuditEvent.HealthyResponse, 9200 }
});
Simulate the passage of time to test dead-node resurrection and timeout behavior:
var cluster = Virtual.Elasticsearch
.Bootstrap(3)
.ClientCalls(r => r.FailAlways())
.StaticNodePool()
.AllDefaults();
// Advance time by 30 minutes
cluster.ChangeTime(d => d.AddMinutes(30));
// Nodes marked dead will now be retried
var response = cluster.ClientCall();
Use .Settings() to customize the transport configuration:
var cluster = Virtual.Elasticsearch
.Bootstrap(3)
.ClientCalls(r => r.SucceedAlways())
.StaticNodePool()
.Settings(s => s with
{
DisablePings = true,
MaxRetries = 5
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
Showing the top 1 popular GitHub repositories that depend on Elastic.Transport.VirtualizedCluster:
| Repository | Stars |
|---|---|
|
elastic/elasticsearch-net
This strongly-typed, client library enables working with Elasticsearch. It is the official client maintained and supported by Elastic.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 93 | 6/10/2026 |
| 0.17.3 | 124 | 5/11/2026 |
| 0.17.2 | 107 | 5/11/2026 |
| 0.17.1 | 123 | 4/28/2026 |
| 0.17.0 | 118 | 4/28/2026 |
| 0.16.0 | 118 | 4/20/2026 |
| 0.15.1 | 315 | 3/11/2026 |
| 0.15.0 | 133 | 2/24/2026 |
| 0.14.0 | 282 | 2/23/2026 |
| 0.13.0 | 137 | 2/23/2026 |
| 0.12.0 | 197 | 2/20/2026 |
| 0.11.1 | 129 | 2/17/2026 |
| 0.11.0 | 163 | 2/16/2026 |
| 0.10.3 | 157 | 1/22/2026 |
| 0.10.2 | 447 | 12/8/2025 |
| 0.10.1 | 382 | 8/19/2025 |
| 0.10.0 | 284 | 8/12/2025 |
| 0.9.2 | 418 | 5/29/2025 |
| 0.9.1 | 334 | 5/28/2025 |
| 0.9.0 | 324 | 5/28/2025 |