Esempio n. 1
0
 public PulsarSender(DotPulsarEndpoint endpoint, CancellationToken cancellationToken)
 {
     _endpoint          = endpoint;
     _cancellationToken = cancellationToken;
     _publisher         = endpoint.PulsarClient.CreateProducer(endpoint.ProducerOptions);
     _protocol          = new DotPulsarTransportProtocol();
 }
Esempio n. 2
0
 public DotPulsarListener(DotPulsarEndpoint endpoint, ITransportLogger logger, CancellationToken cancellation)
 {
     _endpoint     = endpoint;
     _logger       = logger;
     _cancellation = cancellation;
     _protocol     = new DotPulsarTransportProtocol();
     _consumer     = endpoint.PulsarClient.CreateConsumer(endpoint.ConsumerOptions);
 }
Esempio n. 3
0
        public void parse_durable_uri()
        {
            var endpoint = new DotPulsarEndpoint();

            endpoint.Parse(new Uri($"{PulsarPersistence.Persistent}://tenant/jasper/key1/durable"));

            endpoint.Mode.ShouldBe(EndpointMode.Durable);
            endpoint.Topic.TopicName.ShouldBe("key1");
        }
Esempio n. 4
0
        public void parse_non_durable_non_persistent_uri()
        {
            var endpoint = new DotPulsarEndpoint();

            endpoint.Parse(new Uri($"{PulsarPersistence.NonPersistent}://tenant/jasper/key1"));

            endpoint.Mode.ShouldBe(EndpointMode.BufferedInMemory);
            endpoint.Topic.Persistence.ShouldBe(PulsarPersistence.NonPersistent);
        }
Esempio n. 5
0
        public override Uri BuildUriForTopic(string topic)
        {
            // TODO -- evaluate whether or not we really want the default to be durable
            var endpoint = new DotPulsarEndpoint
            {
                Mode  = EndpointMode.Durable,
                Topic = topic
            };

            return(endpoint.Uri);
        }
Esempio n. 6
0
        public void non_persistent_pulsar_topic_parts_match(string tenant, string @namespace, string topic)
        {
            var endpoint = new DotPulsarEndpoint();

            endpoint.Parse(new Uri($"{PulsarPersistence.NonPersistent}://{tenant}/{@namespace}/{topic}"));

            endpoint.Topic.Persistence.ShouldBe(PulsarPersistence.NonPersistent);
            endpoint.Topic.Tenant.ShouldBe(tenant);
            endpoint.Topic.Namespace.ShouldBe(@namespace);
            endpoint.Topic.TopicName.ShouldBe(topic);
        }