Iggy 0.0.7
See the version list below for details.
dotnet add package Iggy --version 0.0.7
NuGet\Install-Package Iggy -Version 0.0.7
<PackageReference Include="Iggy" Version="0.0.7" />
<PackageVersion Include="Iggy" Version="0.0.7" />
<PackageReference Include="Iggy" />
paket add Iggy --version 0.0.7
#r "nuget: Iggy, 0.0.7"
#:package Iggy@0.0.7
#addin nuget:?package=Iggy&version=0.0.7
#tool nuget:?package=Iggy&version=0.0.7
<div align="center">
</div>
C# SDK for Iggy
Getting Started
The whole SDK revolves around IMessageStream
interface to create an instance of it, use following code
var bus = MessageStreamFactory.CreateMessageStream(x =>
{
x.Protocol = Protocol.Http;
x.BaseAddress = "http://localhost:8080";
});
Currently supported transfer protocols
- TCP
- HTTP
Creating first stream
In order to create stream call CreateStreamAsync
method
bus.CreateStreamAsync(new StreamRequest
{
Name = "First Stream",
StreamId = 1,
});
Every stream has a topic to which you can broadcast messages, to create a topic
use CreateTopicAsync
method
bus.CreateTopicAsync(streamId, new TopicRequest
{
Name = "First Topic",
PartitionsCount = 3,
TopicId = 1
});
To send messages you can use SendMessagesAsync
method.
var messages = new List<Message>();
await bus.SendMessagesAsync(streamId, topicId, new MessageSendRequest
{
Messages = messages,
Partitioning = Partitioning.PartitionId(partitionId)
});
The Message
struct has two fields Id
and Payload
struct Message
{
public required Guid Id { get; init; }
public required byte[] Payload { get; init; }
}
Polling messages is done with PollMessagesAsync
var messages = await bus.PollMessagesAsync(new MessageFetchRequest
{
StreamId = streamId,
TopicId = topicId,
Consumer = Consumer.New(consumerId),
Count = 1,
PartitionId = partitionId,
PollingStrategy = MessagePolling.Next,
Value = 0,
AutoCommit = true
});
With version 0.0.5 a new api for PollMessagesAsync
and SendMessagesAsync
has been added, that allows user
to provide custom serializer/deserializer.
SendMessages:
Func<Product, byte[]> serialier = // provide your own serializer.
var messages = new List<Product>();
await bus.SendMessagesAsync<Product>(streamId, topicId, Partitioning.PartitionId(partitionId), messages, serializer);
PollMessages:
Func<byte[], Product> deserializer = // provide your own deserializer.
var messages = await bus.PollMessagesAsync<Product>(new MessageFetchRequest<Product>
{
StreamId = streamId,
TopicId = topicId,
Consumer = Consumer.New(consumerId),
Count = 1,
PartitionId = partitionId,
PollingStrategy = MessagePolling.Next,
Value = 0,
AutoCommit = true
}, deserializer);
In version 0.0.6 an optional encryptor/decryptor parameter to SendMessagesAsync
and PollMessagesAsync
has been added.
It is worth noting that every method will throw an InvalidResponseException
when encountering an error.<br><br>
If you register IMessageStream
in a dependency injection container, you will have access to interfaces
that encapsulate smaller parts of the system IStreamClient
ITopicClient
IMessageClient
IOffsetClient
IConsumerGroupClient
IUtilsClient
IPartitionClient
For more information about how Iggy works check its documentation
Producer / Consumer Sample
https://github.com/iggy-rs/iggy-dotnet-client/assets/112548209/3a89d2f5-d066-40d2-8b82-96c3e338007e
To run the samples, first get Iggy, Run the server with cargo r --bin server
, then get the SDK, cd into Iggy_SDK
and run following commands: dotnet run -c Release --project Iggy_Sample_Producer
for producer, dotnet run -c Release --project Iggy_Sample_Consumer
for consumer.
TODO
- Add support for
ASP.NET Core
Dependency Injection
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated | |
---|---|---|---|
0.1.0 | 185 | 3/28/2024 | |
0.0.189 | 157 | 1/22/2024 | |
0.0.20 | 154 | 3/19/2024 | |
0.0.19 | 150 | 1/22/2024 | |
0.0.18 | 162 | 11/11/2023 | |
0.0.17 | 206 | 10/14/2023 | |
0.0.16 | 185 | 10/3/2023 | |
0.0.15 | 188 | 9/25/2023 | |
0.0.14 | 177 | 9/25/2023 | |
0.0.13 | 193 | 9/23/2023 | |
0.0.12 | 192 | 9/21/2023 | |
0.0.11 | 207 | 9/9/2023 | |
0.0.10 | 201 | 9/3/2023 | |
0.0.9 | 222 | 8/29/2023 | |
0.0.8 | 224 | 8/22/2023 | |
0.0.7 | 216 | 8/21/2023 | |
0.0.6 | 229 | 8/17/2023 | |
0.0.5 | 229 | 8/10/2023 | |
0.0.4 | 254 | 8/5/2023 | |
0.0.3 | 224 | 7/31/2023 | |
0.0.2 | 238 | 7/27/2023 | |
0.0.1 | 279 | 7/27/2023 |