use of org.eclipse.hono.client.telemetry.amqp.ProtonBasedDownstreamSender in project hono by eclipse.
the class ApplicationConfig method eventSenderProvider.
/**
* Creates a client for publishing events via the configured messaging systems.
*
* @return The client.
*/
@Bean
@Scope("prototype")
public MessagingClientProvider<EventSender> eventSenderProvider() {
final MessagingClientProvider<EventSender> result = new MessagingClientProvider<>();
if (downstreamSenderConfig().isHostConfigured()) {
result.setClient(new ProtonBasedDownstreamSender(HonoConnection.newConnection(vertx(), downstreamSenderConfig(), tracer()), SendMessageSampler.Factory.noop(), true, true));
}
if (kafkaEventConfig().isConfigured()) {
final KafkaProducerFactory<String, Buffer> factory = CachingKafkaProducerFactory.sharedFactory(vertx());
result.setClient(new KafkaBasedEventSender(vertx(), factory, kafkaEventConfig(), true, tracer()));
}
healthCheckServer().registerHealthCheckResources(ServiceClientAdapter.forClient(result));
return result;
}
use of org.eclipse.hono.client.telemetry.amqp.ProtonBasedDownstreamSender in project hono by eclipse.
the class AmqpServerFactory method eventSenderProvider.
/**
* Creates a client for publishing events via the configured messaging systems.
*
* @return The client.
*/
private MessagingClientProvider<EventSender> eventSenderProvider() {
final MessagingClientProvider<EventSender> result = new MessagingClientProvider<>();
if (downstreamSenderConfig.isHostConfigured()) {
result.setClient(new ProtonBasedDownstreamSender(HonoConnection.newConnection(vertx, downstreamSenderConfig, tracer), SendMessageSampler.Factory.noop(), true, true));
}
if (eventKafkaProducerConfig.isConfigured()) {
final KafkaProducerFactory<String, Buffer> factory = CachingKafkaProducerFactory.sharedFactory(vertx);
result.setClient(new KafkaBasedEventSender(vertx, factory, eventKafkaProducerConfig, true, tracer));
}
healthCheckServer.registerHealthCheckResources(ServiceClientAdapter.forClient(result));
return result;
}
use of org.eclipse.hono.client.telemetry.amqp.ProtonBasedDownstreamSender in project hono by eclipse.
the class AmqpServerFactory method eventSenderProvider.
/**
* Creates a client for publishing events via the configured messaging systems.
*
* @return The client.
*/
private MessagingClientProvider<EventSender> eventSenderProvider() {
final MessagingClientProvider<EventSender> result = new MessagingClientProvider<>();
if (downstreamSenderConfig.isHostConfigured()) {
result.setClient(new ProtonBasedDownstreamSender(HonoConnection.newConnection(vertx, downstreamSenderConfig, tracer), SendMessageSampler.Factory.noop(), true, true));
}
if (eventKafkaProducerConfig.isConfigured()) {
final KafkaProducerFactory<String, Buffer> factory = CachingKafkaProducerFactory.sharedFactory(vertx);
result.setClient(new KafkaBasedEventSender(vertx, factory, eventKafkaProducerConfig, true, tracer));
}
healthCheckServer.registerHealthCheckResources(ServiceClientAdapter.forClient(result));
return result;
}
Aggregations