use of org.eclipse.hono.commandrouter.AdapterInstanceStatusService in project hono by eclipse.
the class InternalKafkaTopicCleanupServiceTest method setUp.
/**
* Sets up fixture.
*/
@BeforeEach
public void setUp() {
final Vertx vertx = mock(Vertx.class);
adapterInstanceStatusService = mock(AdapterInstanceStatusService.class);
kafkaAdminClient = mock(KafkaAdminClient.class);
internalKafkaTopicCleanupService = new InternalKafkaTopicCleanupService(vertx, adapterInstanceStatusService, kafkaAdminClient);
internalKafkaTopicCleanupService.start();
}
use of org.eclipse.hono.commandrouter.AdapterInstanceStatusService in project hono by eclipse.
the class Application method commandConsumerFactoryProvider.
private MessagingClientProvider<CommandConsumerFactory> commandConsumerFactoryProvider(final TenantClient tenantClient, final CommandTargetMapper commandTargetMapper) {
final MessagingClientProvider<CommandConsumerFactory> commandConsumerFactoryProvider = new MessagingClientProvider<>();
if (kafkaConsumerConfig.isConfigured() && commandResponseKafkaProducerConfig.isConfigured() && commandInternalKafkaProducerConfig.isConfigured()) {
final KafkaProducerFactory<String, Buffer> kafkaProducerFactory = CachingKafkaProducerFactory.sharedFactory(vertx);
kafkaProducerFactory.setMetricsSupport(kafkaClientMetricsSupport);
if (internalKafkaTopicCleanupService == null && commandInternalKafkaProducerConfig.isConfigured() && kafkaConsumerConfig.isConfigured() && kafkaAdminClientConfig.isConfigured() && !(adapterInstanceStatusService instanceof AdapterInstanceStatusService.UnknownStatusProvidingService)) {
internalKafkaTopicCleanupService = new InternalKafkaTopicCleanupService(vertx, adapterInstanceStatusService, kafkaAdminClientConfig);
}
commandConsumerFactoryProvider.setClient(new KafkaBasedCommandConsumerFactoryImpl(vertx, tenantClient, commandTargetMapper, kafkaProducerFactory, commandInternalKafkaProducerConfig, commandResponseKafkaProducerConfig, kafkaConsumerConfig, metrics, kafkaClientMetricsSupport, tracer, internalKafkaTopicCleanupService));
}
if (commandConsumerConnectionConfig.isHostConfigured()) {
commandConsumerFactoryProvider.setClient(new ProtonBasedCommandConsumerFactoryImpl(HonoConnection.newConnection(vertx, commandConsumerConnectionConfig, tracer), tenantClient, commandTargetMapper, metrics, SendMessageSampler.Factory.noop()));
}
return commandConsumerFactoryProvider;
}
Aggregations