RabbitMQ client for the stream protocol
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.2...v1.8.3
Thank you to:
And to @vivek-singh2 for testing the client
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.1...v1.8.2
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.0...v1.8.1
This version is a bug fix for the 1.8.0
Please read the full release notes here:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/releases/tag/v1.8.0
(Below, you can find all the changes/PRs)
The 1.8 focus are:
The high-level classes Consumer
and Producer
don't introduce breaking changes.
The RawSuperStream*
classes change the default behaviour. Please take a look at the section 3.
Main changes:
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig {
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 200 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 200 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 200
.
Handle streamNotAvailable
, Add disconnection Info: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
Improve the super stream reconnection: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
Increase the backoff strategy time: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/345
Please follow this document If you want to know more about what happens during a broker restart.
The focus is to improve the reconnection during the cluster restart.
Removed the auto-reconnect. The RawSuperStreamProducer
and RawSuperStreamConsumer
classes now expose two events:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
**NOTE: If you are using these classes, the auto-reconnect is removed to be compliant with all the Raw*
classes. **
You should use Consumer
and Producer
unless for a specific use case.
var consumer = await system.CreateSuperStreamConsumer(configuration);
var completed = new TaskCompletionSource<bool>();
configuration.ConnectionClosedHandler = async (reason, stream) =>
{
if (reason == ConnectionClosedReason.Unexpected)
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false)
);
completed.SetResult(true);
}
};
The same is true for the standard consumer.
MetadataHandler = async update =>
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false));
}
Producer
and Consumer
classesSee: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/349
See also: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/tree/main/docs/ReliableClient
where you can find an example of how to use StatusChanged
producerConfig.StatusChanged += (status) =>
{
var streamInfo = status.Partition is not null
? $" Partition {status.Partition} of super stream: {status.Stream}"
: $"Stream: {status.Stream}";
lp.LogInformation("Producer: {Id} - status changed from {From} to {To}. {Info}",
status.Identifier,
status.From,
status.To, streamInfo);
if (status.To == ReliableEntityStatus.Open)
{
publishEvent.Set();
}
else
{
publishEvent.Reset();
}};
See https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/342
See: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/357
There are two ways to create the super-stream:
const string SuperStream = "my-first-system-super-stream";
var spec = new PartitionsSuperStreamSpec(SuperStream, 2);
await system.CreateSuperStream(spec);
const string SuperStream = "countries";
var system = await StreamSystem.Create(new StreamSystemConfig());
var conf = new BindingsSuperStreamSpec(SuperStream, new[] { "italy", "france", "spain", "germany", "uk" });
await system.CreateSuperStream(conf);
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.7.4...v1.8.0
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.0-rc.2...v1.8.0-rc.3
The 1.8 focus are:
The high-level classes Consumer
and Producer
don't introduce breaking changes.
The RawSuperStream*
classes change the default behaviour. Please take a look at the section 3.
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig {
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 200 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 200 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 200
.
Handle streamNotAvailable
, Add disconnection Info: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
Improve the super stream reconnection: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
Increase the backoff strategy time: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/345
Please follow this document If you want to know more about what happens during a broker restart.
The focus is to improve the reconnection during the cluster restart.
Removed the auto-reconnect. The RawSuperStreamProducer
and RawSuperStreamConsumer
classes now expose two events:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
**NOTE: If you are using these classes, the auto-reconnect is removed to be compliant with all the Raw*
classes. **
You should use Consumer
and Producer
unless for a specific use case.
var consumer = await system.CreateSuperStreamConsumer(configuration);
var completed = new TaskCompletionSource<bool>();
configuration.ConnectionClosedHandler = async (reason, stream) =>
{
if (reason == ConnectionClosedReason.Unexpected)
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false)
);
completed.SetResult(true);
}
};
The same is true for the standard consumer.
MetadataHandler = async update =>
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false));
}
Producer
and Consumer
classesSee: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/349
See also: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/tree/main/docs/ReliableClient
where you can find an example of how to use StatusChanged
producerConfig.StatusChanged += (status) =>
{
var streamInfo = status.Partition is not null
? $" Partition {status.Partition} of super stream: {status.Stream}"
: $"Stream: {status.Stream}";
lp.LogInformation("Producer: {Id} - status changed from {From} to {To}. {Info}",
status.Identifier,
status.From,
status.To, streamInfo);
if (status.To == ReliableEntityStatus.Open)
{
publishEvent.Set();
}
else
{
publishEvent.Reset();
}};
See https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/342
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.0-rc.1...v1.8.0-rc.2
The 1.8 focus are:
The high-level classes Consumer
and Producer
don't introduce breaking changes.
The RawSuperStream*
classes change the default behaviour. Please take a look at the section 3.
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig {
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 200 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 200 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 200
.
Handle streamNotAvailable
, Add disconnection Info: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
Improve the super stream reconnection: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
Increase the backoff strategy time: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/345
Please follow this document If you want to know more about what happens during a broker restart.
The focus is to improve the reconnection during the cluster restart.
Removed the auto-reconnect. The RawSuperStreamProducer
and RawSuperStreamConsumer
classes now expose two events:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
**NOTE: If you are using these classes, the auto-reconnect is removed to be compliant with all the Raw*
classes. **
You should use Consumer
and Producer
unless for a specific use case.
var consumer = await system.CreateSuperStreamConsumer(configuration);
var completed = new TaskCompletionSource<bool>();
configuration.ConnectionClosedHandler = async (reason, stream) =>
{
if (reason == ConnectionClosedReason.Unexpected)
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false)
);
completed.SetResult(true);
}
};
The same is true for the standard consumer.
MetadataHandler = async update =>
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false));
}
Producer
and Consumer
classesSee: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/349
See also: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/tree/main/docs/ReliableClient
where you can find an example of how to use StatusChanged
producerConfig.StatusChanged += (status) =>
{
var streamInfo = status.Partition is not null
? $" Partition {status.Partition} of super stream: {status.Stream}"
: $"Stream: {status.Stream}";
lp.LogInformation("Producer: {Id} - status changed from {From} to {To}. {Info}",
status.Identifier,
status.From,
status.To, streamInfo);
if (status.To == ReliableEntityStatus.Open)
{
publishEvent.Set();
}
else
{
publishEvent.Reset();
}};
See https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/342
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.0-beta.2...v1.8.0-rc.1
The 1.8 focus are:
The high-level classes Consumer
and Producer
don't introduce breaking changes.
The RawSuperStream*
classes change the default behaviour. Please take a look at the section 3.
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig {
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 200 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 200 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 200
.
Handle streamNotAvailable
, Add disconnection Info: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
Improve the super stream reconnection: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
Increase the backoff strategy time: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/345
Please follow this document If you want to know more about what happens during a broker restart.
The focus is to improve the reconnection during the cluster restart.
Removed the auto-reconnect. The RawSuperStreamProducer
and RawSuperStreamConsumer
classes now expose two events:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
**NOTE: If you are using these classes, the auto-reconnect is removed to be compliant with all the Raw*
classes. **
You should use Consumer
and Producer
unless for a specific use case.
var consumer = await system.CreateSuperStreamConsumer(configuration);
var completed = new TaskCompletionSource<bool>();
configuration.ConnectionClosedHandler = async (reason, stream) =>
{
if (reason == ConnectionClosedReason.Unexpected)
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false)
);
completed.SetResult(true);
}
};
The same is true for the standard consumer.
MetadataHandler = async update =>
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false));
}
Producer
and Consumer
classesSee: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/349
See also: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/tree/main/docs/ReliableClient
where you can find an example of how to use StatusChanged
producerConfig.StatusChanged += (status) =>
{
var streamInfo = status.Partition is not null
? $" Partition {status.Partition} of super stream: {status.Stream}"
: $"Stream: {status.Stream}";
lp.LogInformation("Producer: {Id} - status changed from {From} to {To}. {Info}",
status.Identifier,
status.From,
status.To, streamInfo);
if (status.To == ReliableEntityStatus.Open)
{
publishEvent.Set();
}
else
{
publishEvent.Reset();
}};
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.8.0-beta.1...v1.8.0-beta.2
The 1.8 focus are:
The high-level classes Consumer
and Producer
don't introduce breaking changes.
The RawSuperStream*
classes change the default behaviour. Please take a look at the section 3.
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig {
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 200 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 200 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig{
ConnectionPoolConfig = new ConnectionPoolConfig() {
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 200
.
Handle streamNotAvailable
, Add disconnection Info: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
Improve the super stream reconnection: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
Increase the backoff strategy time: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/345
Please follow this document If you want to know more about what happens during a broker restart.
The focus is to improve the reconnection during the cluster restart.
Removed the auto-reconnect. The RawSuperStreamProducer
and RawSuperStreamConsumer
classes now expose two events:
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
**NOTE: If you are using these classes, the auto-reconnect is removed to be compliant with all the Raw*
classes. **
You should use Consumer
and Producer
unless for a specific use case.
var consumer = await system.CreateSuperStreamConsumer(configuration);
var completed = new TaskCompletionSource<bool>();
configuration.ConnectionClosedHandler = async (reason, stream) =>
{
if (reason == ConnectionClosedReason.Unexpected)
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false)
);
completed.SetResult(true);
}
};
The same is true for the standard consumer.
MetadataHandler = async update =>
{
await consumer.ReconnectPartition(
await system.StreamInfo(stream).ConfigureAwait(false));
}
The RabbitMQ stream protocol supports multi-producers and multi-consumers per TCP Connection. This version introduces the connection pool for Consumers and Producers.
There is a new ConnectionPoolConfig
setting:
new StreamSystemConfig
{
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 10,
ProducersPerConnection = 10,
}
};
ConsumersPerConnection
== The number of consumers per connection min 1 max 255 default is 1
ProducersPerConnection
== The number of producers per connection min 1 max 255 default is 1
Each connection can handle different streams; see the image:
Sharing the same connection for multiple streams reduces the number of connections, but it could impact the performances:
The proper parameter depends on your environment.
You can use different StreamSystemConfig
like:
configToReduceTheConnections = new StreamSystemConfig
{
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 50, // high value
ProducersPerConnection = 50, // high value
}
}
configToIncreaseThePerformances = new StreamSystemConfig
{
ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConsumersPerConnection = 1, // low value
ProducersPerConnection = 1, // low value
}
}
There are many combinations from 1
to 255
.
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.7.4...v1.8.0-beta.1
new ProducerConfig(system, stream)
{
TimeoutMessageAfter = TimeSpan.FromSeconds(2), // here
Full Changelog: https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/compare/v1.7.3...v1.7.4