Skip to content

Instantly share code, notes, and snippets.

public interface IEventTopicMapper
{
/// <summary>
/// Determine the kafka topic and partion, as well as the key for this particular topic persistenceId
/// </summary>
/// <param name="persistenceId"></param>
/// <returns></returns>
Tuple<TopicPartition, byte[]> GetTopicPartitionForPersistenceId(string persistenceId);
}
@AndreSteenbergen
AndreSteenbergen / mock.cs
Created September 30, 2018 16:17
PostStop not called
using System;
using System.Threading.Tasks;
using Akka.Streams.Stage;
using Akka.Util.Internal;
using Confluent.Kafka;
namespace Akka.Streams.Kafka.Stages
{
internal sealed class ProducerStageLogicMock<K, V> : GraphStageLogic
{
@AndreSteenbergen
AndreSteenbergen / Program.cs
Last active September 29, 2018 22:06
Migrating kafka topics from source to sink
using Akka;
using Akka.Actor;
using Akka.Configuration;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Kafka.Dsl;
using Akka.Streams.Kafka.Messages;
using Akka.Streams.Kafka.Settings;
using Akka.Util;
using Confluent.Kafka;
@AndreSteenbergen
AndreSteenbergen / UnboundedStablePriorityMailbox.cs
Last active July 5, 2018 14:28
UnboundedStablePriorityMailbox For Akka.Net
/// <summary>
/// Priority queue implemented using a simple list with binary search for inserts.
/// This specific implementation is cheap in terms of memory but weak in terms of performance.
/// See http://visualstudiomagazine.com/articles/2012/11/01/priority-queues-with-c.aspx for original implementation
/// This specific version is adapted for Envelopes only and calculates a priority of envelope.Message
/// </summary>
public sealed class StableListPriorityQueue
{
private struct WrappedEnvelope