예제 #1
0
 private async Task SendAsync(PacketContainer container, IRoutingInformation routingInfos)
 {
     await _client.PublishAsync(builder => builder
                                .WithPayload(_serializer.Serialize(container))
                                .WithTopic(routingInfos.OutgoingTopic)
                                .WithExactlyOnceQoS());
 }
예제 #2
0
        private async Task SendAsync(PacketContainer container)
        {
            IRoutingInformation infos = await CheckRouting(container.Type);

            await _client.PublishAsync(builder =>
                                       builder
                                       .WithPayload(_serializer.Serialize(container))
                                       .WithTopic(infos.IncomingTopic)
                                       .WithExactlyOnceQoS()
                                       );
        }
예제 #3
0
        private async Task SendAsync <T>(PacketContainer container)
        {
            IRoutingInformation infos = GetRoutingInformations <T>();

            MessageSent.WithLabels(_options.ClientOptions.ClientId, infos.Topic).Inc();
            await _client.PublishAsync(builder =>
                                       builder
                                       .WithPayload(_serializer.Serialize(container))
                                       .WithTopic(infos.Topic)
                                       .WithExactlyOnceQoS()
                                       );

            Console.WriteLine("Sent message to topic : " + infos.Topic);
        }