public EventsByTagActor(EventsByTag <T> message, IActorRef client, IActorRef lookup, IActorRef cnxPool, IActorRef generator, ISchema <T> schema) { _admin = new Admin.Public.Admin(message.AdminUrl, new HttpClient()); _message = message; _schema = schema; _client = client; _cnxPool = cnxPool; _lookup = lookup; _generator = generator; _buffer = new BufferBlock <IMessage <T> >(); var topic = $"persistent://{message.Tenant}/{message.Namespace}/{message.Topic}"; var partitions = _admin.GetPartitionedMetadata(message.Tenant, message.Namespace, message.Topic); Setup(partitions.Body, topic); Receive <ReceivedMessage <T> >(m => { _buffer.Post(m.Message); }); Receive <Messages.Receive>(_ => { if (_buffer.TryReceive(out var message)) { Sender.Tell(new AskResponse(message)); } else { Sender.Tell(new AskResponse(null)); } }); }
public SqlSource(string brokerWebServiceUrl, BufferBlock <IEventEnvelope> buffer, IActorRef sourceActor) { _buffer = buffer; _eventSource = sourceActor; _httpclient = new HttpClient(); _admin = new Admin.Public.Admin(brokerWebServiceUrl, _httpclient, true); }
public EventsByTagActor(EventsByTag message, BufferBlock <IEventEnvelope> buffer) { _admin = new Admin.Public.Admin(message.AdminUrl, new HttpClient()); _message = message; _buffer = buffer; var topic = $"persistent://{message.Tenant}/{message.Namespace}/{message.Topic}"; var partitions = _admin.GetPartitionedMetadata(message.Tenant, message.Namespace, message.Topic, true); Setup(partitions.Body); }
public ProducerCommitAbort(ITestOutputHelper output, PulsarStandaloneClusterFixture fixture) { _output = output; _client = fixture.Client; _admin = new Admin.Public.Admin("http://localhost:8080/", new HttpClient()); try { //var response = _admin.SetRetention("public", "default", retentionPolicies: new SharpPulsar.Admin.Models.RetentionPolicies(retentionTimeInMinutes: 3600, retentionSizeInMB: 1000)); //var bla = response; } catch { } }
public CurrentEventsByTagActor(CurrentEventsByTag message, BufferBlock <IEventEnvelope> buffer) { _admin = new Admin.Public.Admin(message.AdminUrl, new HttpClient()); _buffer = buffer; _message = message; var topic = $"persistent://{message.Tenant}/{message.Namespace}/{message.Topic}"; var partitions = _admin.GetPartitionedMetadata(message.Tenant, message.Namespace, message.Topic); Setup(partitions.Body); Receive <Terminated>(t => { var children = Context.GetChildren(); if (!children.Any()) { Context.System.Log.Info($"All children exited, shutting down in 5 seconds :{Self.Path}"); Self.GracefulStop(TimeSpan.FromSeconds(5)); } }); }
public CurrentEventsByTopicActor(CurrentEventsByTopic <T> message, IActorRef client, IActorRef lookup, IActorRef cnxPool, IActorRef generator, ISchema <T> schema) { _admin = new Admin.Public.Admin(message.AdminUrl, new HttpClient()); _message = message; _schema = schema; _buffer = new BufferBlock <IMessage <T> >(); _client = client; _cnxPool = cnxPool; _lookup = lookup; _generator = generator; var topic = $"persistent://{message.Tenant}/{message.Namespace}/{message.Topic}"; var partitions = _admin.GetPartitionedMetadata(message.Tenant, message.Namespace, message.Topic); Setup(partitions.Body, topic); Receive <Terminated>(t => { var children = Context.GetChildren(); if (!children.Any()) { Context.System.Log.Info($"All children exited, shutting down in 5 seconds :{Self.Path}"); Self.GracefulStop(TimeSpan.FromSeconds(5)); } }); Receive <ReceivedMessage <T> >(m => { _buffer.Post(m.Message); }); Receive <Messages.Receive>(_ => { if (_buffer.TryReceive(out var message)) { Sender.Tell(new AskResponse(message)); } else { Sender.Tell(new AskResponse(null)); } }); }
public ReaderSource(string brokerWebServiceUrl, IActorRef sourceActor) { _eventSource = sourceActor; _httpclient = new HttpClient(); _admin = new Admin.Public.Admin(brokerWebServiceUrl, _httpclient, true); }