예제 #1
0
    private static KafkaMessagePublisher <TData> GetKafkaPublisher <TData>(
        CloudEventFormat format = CloudEventFormat.Protocol)
    {
        var options = new KafkaPublisherOptions <TData>
        {
            Topic = KafkaTopic
        };

        return(new KafkaMessagePublisher <TData>(Options.Create(options), new JsonEventFormatter(),
                                                 Options.Create(new PublisherOptions {
            CloudEventFormat = format
        })));
    }
예제 #2
0
    private IRawMessagePublisher <string> GetPublisher(
        IRabbitMQConnectionFactory <string>?factory = null,
        RabbitMQPublisherOptions <string>?options   = null,
        bool overwriteExchange            = false,
        CloudEventFormat cloudEventFormat = CloudEventFormat.Protocol)
    {
        options ??= GetConfig(overwriteExchange);
        factory ??= GetDefaultConnectionFactoryMock <string>().Object;

        var optionsMock = Options.Create(options);

        return(new RabbitMQMessagePublisher <string>(
                   factory,
                   optionsMock,
                   Options.Create(new PublisherOptions {
            CloudEventFormat = cloudEventFormat
        }),
                   new JsonEventFormatter()
                   ));
    }
 private NATSMessagePublisher<string> GetPublisher(IOptions<NATSBaseOptions> clientOptions, CloudEventFormat cloudEventFormat = CloudEventFormat.Protocol)
 {
     return new NATSMessagePublisher<string>(clientOptions, new NATSClientFactory(), new JsonEventFormatter(),
         MSOptions.Create(new PublisherOptions { CloudEventFormat = cloudEventFormat }));
 }
예제 #4
0
 public UnhandledCloudEventFormatException(CloudEventFormat cloudEventFormat) : base($"Unhandled CloudEventFormat {cloudEventFormat}")
 {
 }