GithubHelp home page GithubHelp logo

nservicebus.kafka's People

Contributors

danielmarbach avatar pablocastilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nservicebus.kafka's Issues

JSON parsing error

I have a simple application set up to test NServiceBus with Kafka. Finally set up ZooKeeper and Kakfa correctly.

But when running my .NET application I'm getting an error about that it couldn't parse the JSON correctly. What gives? See screenshot.

http://imgur.com/a/wD50W

QueueCreation and debugging

While investigating issue #4 I was wondering why a console window pops up when the acceptance tests are executed. It turns out it is the queue creator. As far as I understand you are using the batch files to create the topics necessary to run the acceptance tests. While that works it makes debugging hard. On my machine every time I try to attach the debugger to an acceptance test I get the following exception:

System.IO.IOException : The pipe has been ended.

   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<Run>d__0.MoveNext() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 66
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.AcceptanceTesting.ScenarioWithContext`1.<Run>d__2.MoveNext() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.AcceptanceTesting\ScenarioWithContext.cs:line 57
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.AcceptanceTesting.ScenarioWithContext`1.<NServiceBus-AcceptanceTesting-Support-IScenarioWithEndpointBehavior<TContext>-Run>d__9.MoveNext() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.AcceptanceTesting\ScenarioWithContext.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at 

For better debugging experience I did the following:

  • Replace the queue creator with an empty queue creator
  • Enable
# Auto create topic
auto.create.topics.enable=true

in server.properties and restarted the broker.

I think shelling out into cmd.exe is not really a sustainable solution but unfortunately I don't have a good proposal to fix it since I'm still lacking lot of context so I'll just leave this here.

Consumer when using Kafka Transport fails to start

I have successfully sent a message using NServiceBus configure with a Kafka Transport, but am unable to receive the message unless listening to Kafka outside of NServiceBus. The following code blows up in a console app:

`var endpointConfiguration = new EndpointConfiguration("Sales");

		var transport = endpointConfiguration.UseTransport<KafkaTransport>();
		transport.ConnectionString("127.0.0.1:9092");

		endpointConfiguration.UseSerialization<JsonSerializer>();
		endpointConfiguration.UsePersistence<InMemoryPersistence>();
		endpointConfiguration.SendFailedMessagesTo("error");
		endpointConfiguration.EnableInstallers();

		var endpointInstance = await Endpoint.Start(endpointConfiguration).ConfigureAwait(false);

		Console.WriteLine("Press Enter to exit...");
		Console.ReadLine();

`

The error indicated is: 2017-03-14 14:23:37.032 WARN NServiceBus.Transport.Kafka.Receiving.MessagePump System.ComponentModel.Win32Exception (0x80004005): The directory name is invalid
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at NServiceBus.Transport.Kafka.Receiving.QueueCreator.d__3.MoveNext()

I'm using NServiceBus 6.1.3 and the latest Kafka Transport library from NuGet.

Receiving messages has side effects with offsets to commit

It might be that I don't yet fully understand the usage of the kafka clients. When I was looking at

https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L206

I had some spider senses tingling. For me the code read like

Whenever a message is completed we loop through OffsetsReceived https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L194 and commit all those that can be completed, essentially batching offsets to complete together but only triggered due to processing of messages.

Wouldn't it be more safe to do the following:

  • Only complete things that can be truly associated with the message received

or apply smart background batching similar to what we do in Azure Service Bus.

Particular/NServiceBus.AzureServiceBus#384

ConsumerHolder Continuation missuse and missing await

The consumer holder uses

https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L186

and specifies ExecuteSynchronously

https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L229

although it actually executes IO-bound work

https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L225

There are multiple problems due to that:

If you stick to that pattern you have to remove the ExecuteSynchronously since you are violating the TPL constraints that a continuation with that flag should only execute synchronous and really short lived operations as well as mark the lambda as async and properly await the commit. If you don't do that you'll never find out when the commit fails

but overall I think this code is unnecessarily complex since you could write the same code inside the Process method with normal async await pattern

https://github.com/pablocastilla/NServiceBus.Kafka/blob/master/src/NServiceBus.Kafka/Connection/ConsumerHolder.cs#L262

in the acceptance tests with addmapping it doesn't find any handler

Hi @danielmarbach @janovesk!

I hope you can help me with this issue that is making me crazy.

The problem is that when I use acceptance tests with addmapping I always get (for instance):
"No handlers could be found for message type: NServiceBus.AcceptanceTests.Basic.When_sending_to_another_endpoint+MyMessage"

I don't know what I am doing wrong.

Do you know what could be the reason for this?

Thanks.

Not implementing callbacks

Hi @ danielmarbach !

From the begining I wanted the transport elastic. Services with the same name are subscribed to the same kafka topic sharing it. The problem is I think it is impossible to implement the callback feature in the sending, as the sender could not receive the message if it is scaled out because it can be processed by another endpoint.

For me it is ok and I suppose this is a normal scenario with this kind of transports.

How do you see it?

Exception when defering messages

Hi @danielmarbach !

I have a problem and I am not able to fix it. It is related to defering messages.

When I defer any message I have an exception related to a header called "Timeout.Id" but I don't know how to generate it and I don't find it in other transports.

What am I missing?

Thanks and have a good weekend!

Exception when executing When_deferring_to_non_local.Message_should_be_received:

Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
error onMessage: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at NServiceBus.DispatchTimeoutBehavior.d__1.MoveNext() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\DelayedDelivery\TimeoutManager\DispatchTimeoutBehavior.cs:line 20
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at NServiceBus.Transport.Kafka.Receiving.MessagePump.d__23.MoveNext() in C:\Users\sesa221523\Source\Repos\NServiceBus.Kafka\src\NServiceBus.Kafka\Receiving\MessagePump.cs:line 232

What is the best way to get headers at transport time?

Hi!

As I understand transports need the message headers before pumping the message up in the next part of the pipe. So I need to get them from the message. My problem is that kafka doesn't have any headerbag for it, I only have a byte[] payload.

Do I serialize and deserialize every message at transport level? I could use
https://github.com/rogeralsing/Wire <-- i think now is the fastest
And a short message schema like headers/payload

The problem is that we will have to deserialize the message twice, one in the transport and another one at serialization/deserialization time.

Do you know any better option? @danielmarbach @sfarmar

Thanks

Support for NServiceBus v7?

With v7 just right around the corner are there any plans to update the transport to support it? (there should not be any dramatic changes on the transport seam)

Let let me know if you need any help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.