Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ obj/
*.csproj.user
*.xproj.user
.vs
.vscode
todo.txt
.cache
src/RdKafka/runtimes
src/Confluent.Kafka/runtimes
Properties
packages/
doc/api/
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Origin: https://github.com/ah-/rdkafka-dotnet
# Origin: https://github.com/confluentinc/confluent-kafka-dotnet

language: csharp
sudo: required
Expand All @@ -19,6 +19,6 @@ install:
- dotnet restore

script:
- dotnet build ./src/RdKafka/project.json
- dotnet pack ./src/RdKafka/project.json
- dotnet test ./test/RdKafka.Tests/
- dotnet build ./src/Confluent.Kafka/project.json
- dotnet pack ./src/Confluent.Kafka/project.json
- dotnet test ./test/Confluent.Kafka.Tests/
4 changes: 2 additions & 2 deletions RdKafka.sln → Confluent.Kafka.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RdKafka", "src\RdKafka\RdKafka.xproj", "{B2DDB635-4423-45D7-B3DC-F701E6010868}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Confluent.Kafka", "src\Confluent.Kafka\Confluent.Kafka.xproj", "{B2DDB635-4423-45D7-B3DC-F701E6010868}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a new project uuid generated?

(I have no idea if it has any significance, but it looks random enough to be assumed as unique)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly. But I've done this sort of rename before a lot and never had problems and I'm also pretty sure that if you rename a project within VS it doesn't change the guid. I haven't been using VS yet (this was just a text editor change).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't worried about a plain renaming so much as if someone tries to open both rdkafka-dotnet and confluent-kafka-dotnet in the same IDE. Will they be treated as unique projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there would only potentially be problems if someone tried to add both projects to the same solution (they should never want to - maybe they want to link against the two libraries, but that is different). In the event they do, I just checked and VS automatically generates new guids, it doesn't let them conflict.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need new project UUIDs? Not sure how these are used exactly, but I'd guess that if we keep them the same it could cause conflicts with an rdkafka-dotnet checkout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see other comment

EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RdKafka.Tests", "test\RdKafka.Tests\RdKafka.Tests.xproj", "{33151BE2-C10B-41BC-8C5E-E55211A1722D}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Confluent.Kafka.Tests", "test\Confluent.Kafka.Tests\Confluent.Kafka.Tests.xproj", "{33151BE2-C10B-41BC-8C5E-E55211A1722D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SimpleProducer", "examples\SimpleProducer\SimpleProducer.xproj", "{A7BF0A75-D3E7-4024-8597-5FCCC567D372}"
EndProject
Expand Down
58 changes: 6 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,19 @@
rdkafka-dotnet - C# Apache Kafka client
=======================================
confluent-kafka-dotnet - .NET Apache Kafka client
=================================================

[![Travis Build Status](https://travis-ci.org/ah-/rdkafka-dotnet.svg?branch=master)](https://travis-ci.org/ah-/rdkafka-dotnet)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/ah-/rdkafka-dotnet?branch=master&svg=true)](https://ci.appveyor.com/project/ah-/rdkafka-dotnet)
[![Gitter chat](https://badges.gitter.im/edenhill/librdkafka.png)](https://gitter.im/edenhill/librdkafka)
**confluent-kafka-dotnet** is a .NET client for [Apache Kafka](http://kafka.apache.org/) based on [librdkafka](https://github.com/edenhill/librdkafka).

Copyright (c) 2015-2016, [Andreas Heider](mailto:[email protected])
Forked from [rdkafka-net](https://github.com/ah-/rdkafka-dotnet) by Andreas Heider

**rdkafka-dotnet** is a C# client for [Apache Kafka](http://kafka.apache.org/) based on [librdkafka](https://github.com/edenhill/librdkafka).
Copyright (c) 2016 [Confluent Inc.](https://www.confluent.io), 2015-2016, [Andreas Heider](mailto:[email protected])

**rdkafka-dotnet** is licensed under the 2-clause BSD license.

## Usage

Just reference the [RdKafka NuGet package](https://www.nuget.org/packages/RdKafka)
Just reference the [confluent-kafka-dotnet NuGet package](https://www.nuget.org/packages/confluent-kafka-dotnet)

## Examples
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're stripping out the contents of these sections can we drop them entirely? We can always restore them later (and we should file a JIRA to track that if we need to follow up later once we've cleaned up APIs etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to you on this one - i don't have an opinion either way.


### Producing messages

```cs
using (Producer producer = new Producer("127.0.0.1:9092"))
using (Topic topic = producer.Topic("testtopic"))
{
byte[] data = Encoding.UTF8.GetBytes("Hello RdKafka");
DeliveryReport deliveryReport = await topic.Produce(data);
Console.WriteLine($"Produced to Partition: {deliveryReport.Partition}, Offset: {deliveryReport.Offset}");
}

```

### Consuming messages

```cs
var config = new Config() { GroupId = "example-csharp-consumer" };
using (var consumer = new EventConsumer(config, "127.0.0.1:9092"))
{
consumer.OnMessage += (obj, msg) =>
{
string text = Encoding.UTF8.GetString(msg.Payload, 0, msg.Payload.Length);
Console.WriteLine($"Topic: {msg.Topic} Partition: {msg.Partition} Offset: {msg.Offset} {text}");
};

consumer.Subscribe(new []{"testtopic"});
consumer.Start();

Console.WriteLine("Started consumer, press enter to stop consuming");
Console.ReadLine();
}
```

### More

See `examples/`

## Documentation

[Read the API Documentation here](https://ah-.github.io/rdkafka-dotnet/api/RdKafka.html)

[Read the FAQ for answers to common questions](https://github.com/ah-/rdkafka-dotnet/wiki/Faq)

## Supported Platforms and .NET Releases

Requires .NET 4.5 or later. Tested with .NET Core on Linux, OS X and Windows, and classic .NET 4.5 on Windows.
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ environment:
build_script:
- appveyor-retry dotnet restore -v Minimal
- dotnet build **/project.json -c %CONFIGURATION%
- cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (dotnet pack src/RdKafka/project.json -c %CONFIGURATION%)
- cmd: IF NOT "%APPVEYOR_REPO_TAG%" == "true" (dotnet pack src/RdKafka/project.json -c %CONFIGURATION% --version-suffix ci-%APPVEYOR_BUILD_NUMBER%)
- dotnet test test/RdKafka.Tests
- cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (dotnet pack src/Confluent.Kafka/project.json -c %CONFIGURATION%)
- cmd: IF NOT "%APPVEYOR_REPO_TAG%" == "true" (dotnet pack src/Confluent.Kafka/project.json -c %CONFIGURATION% --version-suffix ci-%APPVEYOR_BUILD_NUMBER%)
- dotnet test test/Confluent.Kafka.Tests

test: off

artifacts:
- path: ./src/RdKafka/bin/Release/*.nupkg
- path: ./src/Confluent.Kafka/bin/Release/*.nupkg

deploy:
provider: NuGet
Expand Down
4 changes: 2 additions & 2 deletions doc/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"src": [
{
"files": [
"src/RdKafka/*.cs"
"src/Confluent.Kafka/*.cs"
],
"cwd": ".."
}
Expand All @@ -23,7 +23,7 @@
}
],
"globalMetadata": {
"_appTitle": "RdKafka",
"_appTitle": "Confluent.Kafka",
"_disableContribution": true,
"_disableFooter": true
},
Expand Down
50 changes: 11 additions & 39 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,19 @@
rdkafka-dotnet - C# Apache Kafka client
=======================================
confluent-kafka-dotnet - .NET Apache Kafka client
=================================================

**rdkafka-dotnet** is a C# client for [Apache Kafka](http://kafka.apache.org/) based on [librdkafka](https://github.com/edenhill/librdkafka).
**confluent-kafka-dotnet** is a .NET client for [Apache Kafka](http://kafka.apache.org/) based on [librdkafka](https://github.com/edenhill/librdkafka).

## Usage
Forked from [rdkafka-net](https://github.com/ah-/rdkafka-dotnet) by Andreas Heider.

Copyright (c) 2016 [Confluent Inc.](https://www.confluent.io), 2015-2016, [Andreas Heider](mailto:[email protected])

Just reference the [RdKafka NuGet package](https://www.nuget.org/packages/RdKafka)

## Api Reference
## Usage

[Read the Api Documentation here](api/RdKafka.html)
Just reference the [confluent-kafka-dotnet NuGet package](https://www.nuget.org/packages/confluent-kafka-dotnet)

## Examples

### Producing messages

```cs
using (Producer producer = new Producer("127.0.0.1:9092"))
using (Topic topic = producer.Topic("testtopic"))
{
byte[] data = Encoding.UTF8.GetBytes("Hello RdKafka");
DeliveryReport deliveryReport = await topic.Produce(data);
Console.WriteLine($"Produced to Partition: {deliveryReport.Partition}, Offset: {deliveryReport.Offset}");
}

```

### Consuming messages

```cs
var config = new Config() { GroupId = "example-csharp-consumer" };
using (var consumer = new EventConsumer(config, "127.0.0.1:9092"))
{
consumer.OnMessage += (obj, msg) =>
{
string text = Encoding.UTF8.GetString(msg.Payload, 0, msg.Payload.Length);
Console.WriteLine($"Topic: {msg.Topic} Partition: {msg.Partition} Offset: {msg.Offset} {text}");
};

consumer.Subscribe(new []{"testtopic"});
consumer.Start();

Console.WriteLine("Started consumer, press enter to stop consuming");
Console.ReadLine();
}
```
## Documentation

## Supported Platforms and .NET Releases
4 changes: 2 additions & 2 deletions doc/toc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- name: Api reference
href: api/RdKafka.html
homepage: api/RdKafka.yml
href: api/Confluent.Kafka.html
homepage: api/Confluent.Kafka.yml
4 changes: 2 additions & 2 deletions examples/AdvancedConsumer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RdKafka;
using Confluent.Kafka;

namespace AdvancedConsumer
namespace Confluent.Kafka.AdvancedConsumer
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions examples/AdvancedConsumer/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/AdvancedProducer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Text;
using System.Threading.Tasks;
using RdKafka;
using Confluent.Kafka;

namespace AdvancedProducer
namespace Confluent.Kafka.AdvancedProducer
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions examples/AdvancedProducer/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
7 changes: 4 additions & 3 deletions examples/Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using RdKafka;
using Confluent.Kafka;

namespace Benchmark
namespace Confluent.Kafka.Benchmark
{
public class Program
{
Expand Down Expand Up @@ -82,7 +82,8 @@ public static void Main(string[] args)
string brokerList = args[0];
string topic = args[1];

long numMessages = 10000000;
long numMessages = 1000000;

var stopwatch = new Stopwatch();

stopwatch.Start();
Expand Down
4 changes: 2 additions & 2 deletions examples/Benchmark/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/Misc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using RdKafka;
using Confluent.Kafka;

namespace Misc
namespace Confluent.Kafka.Misc
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions examples/Misc/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleConsumer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RdKafka;
using Confluent.Kafka;

namespace SimpleProducer
namespace Confluent.Kafka.SimpleProducer
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleConsumer/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleProducer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Text;
using System.Threading.Tasks;
using RdKafka;
using Confluent.Kafka;

namespace SimpleProducer
namespace Confluent.Kafka.SimpleProducer
{
public class Program
{
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleProducer/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0",
"authors": ["Andreas Heider"],
"authors": ["Andreas Heider", "Confluent Inc"],

"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"RdKafka": {
"Confluent.Kafka": {
"target": "project"
}
},
Expand Down
Loading