Skip to content

ZOXEXIVO/mesg

Repository files navigation

mesg

Simple message broker with GRPC protocol

Easy contract

//Full proto-file availabile at running application endpoint: http://localhost:35001/proto
service MesgProtocol {
  rpc Push (PushRequest) returns (PushResponse) {}
  rpc Pull (PullRequest) returns (stream PullResponse) {}
  rpc Commit (CommitRequest) returns (CommitResponse) {}
}

Genereate GRPC client for your language by single .proto file and use it

string queueName =  "test_queue";

var stream = client.Pull(new PullRequest
{
    Queue = queueName,
    Application = Environment.ComputerName
}).ResponseStream;

while (await stream.MoveNext(CancellationToken.None))
{
    try 
    {
        await ProcessAsync(stream.Current.Data);

        await client.Commit(queueName, stream.Current.MessageId);
    }
    catch(Exception ex){

    }    
 }

TODO

  • Broadcast push
  • Persistence
  • Sharding and replication

License

Apache License 2.0