Search in sources :

Example 1 with Pair

use of org.eclipse.hono.util.Pair in project hono by eclipse.

the class IntegrationTestSupport method deleteTenantKafkaTopics.

private Future<Void> deleteTenantKafkaTopics(final List<String> tenantsToDelete) {
    if (!isUsingKafkaMessaging()) {
        return Future.succeededFuture();
    }
    // topics for the given tenants are not deleted right away: It could be that the offset-commit interval of the CommandRouter
    // command consumer (5s) hasn't elapsed yet and it has to be avoided to delete the topics before the consumer has
    // committed corresponding offsets (otherwise the consumer will retry the commit for some time and be blocked during that time)
    final Promise<Void> tenantTopicsDeletionDonePromise = Promise.promise();
    tenantsToDeleteTopicsForAfterDelay.add(Pair.of(tenantsToDelete, Instant.now()));
    final List<String> tenantsToDeleteTopicsForNow = new LinkedList<>();
    final Instant nowMinusCommitInterval = Instant.now().minus(// commit interval with added buffer
    AsyncHandlingAutoCommitKafkaConsumer.DEFAULT_COMMIT_INTERVAL.plusSeconds(1));
    final Iterator<Pair<List<String>, Instant>> iterator = tenantsToDeleteTopicsForAfterDelay.iterator();
    while (iterator.hasNext()) {
        final Pair<List<String>, Instant> tenantsToDeleteAndInstantPair = iterator.next();
        if (tenantsToDeleteAndInstantPair.two().isBefore(nowMinusCommitInterval)) {
            tenantsToDeleteTopicsForNow.addAll(tenantsToDeleteAndInstantPair.one());
            iterator.remove();
        }
    }
    if (!tenantsToDeleteTopicsForNow.isEmpty()) {
        final KafkaAdminClient adminClient = KafkaAdminClient.create(vertx, getKafkaAdminClientConfig().getAdminClientConfig("test"));
        final Promise<Void> adminClientClosedPromise = Promise.promise();
        LOGGER.debug("deleting topics for temporary tenants {}", tenantsToDeleteTopicsForNow);
        final List<String> topicNames = tenantsToDeleteTopicsForNow.stream().flatMap(tenant -> HonoTopic.Type.MESSAGING_API_TYPES.stream().map(type -> new HonoTopic(type, tenant).toString())).collect(Collectors.toList());
        adminClient.deleteTopics(topicNames, ar -> {
            // note that the result will probably have failed with an UnknownTopicOrPartitionException here;
            // not necessarily all tenant topics may have been created before
            LOGGER.debug("done triggering deletion of topics for tenants {}", tenantsToDeleteTopicsForNow);
            adminClient.close(adminClientClosedPromise);
        });
        adminClientClosedPromise.future().recover(thr -> {
            LOGGER.warn("error closing Kafka admin client", thr);
            return Future.succeededFuture();
        }).onComplete(tenantTopicsDeletionDonePromise);
    } else {
        tenantTopicsDeletionDonePromise.complete();
    }
    return tenantTopicsDeletionDonePromise.future();
}
Also used : HttpURLConnection(java.net.HttpURLConnection) X509Certificate(java.security.cert.X509Certificate) KeyPair(java.security.KeyPair) ApplicationClient(org.eclipse.hono.application.client.ApplicationClient) Arrays(java.util.Arrays) MessagingKafkaConsumerConfigProperties(org.eclipse.hono.client.kafka.consumer.MessagingKafkaConsumerConfigProperties) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) TenantConstants(org.eclipse.hono.util.TenantConstants) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) VertxTools(org.eclipse.hono.test.VertxTools) InetAddress(java.net.InetAddress) GeneralSecurityException(java.security.GeneralSecurityException) MessagingType(org.eclipse.hono.util.MessagingType) PskCredential(org.eclipse.hono.service.management.credentials.PskCredential) ProtonBasedApplicationClient(org.eclipse.hono.application.client.amqp.ProtonBasedApplicationClient) Map(java.util.Map) Pair(org.eclipse.hono.util.Pair) JsonObject(io.vertx.core.json.JsonObject) ClientConfigProperties(org.eclipse.hono.config.ClientConfigProperties) KeyPairGenerator(java.security.KeyPairGenerator) Device(org.eclipse.hono.service.management.device.Device) MessageContext(org.eclipse.hono.application.client.MessageContext) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) CachingKafkaProducerFactory(org.eclipse.hono.client.kafka.producer.CachingKafkaProducerFactory) Set(java.util.Set) ConsumerConfig(org.apache.kafka.clients.consumer.ConsumerConfig) UUID(java.util.UUID) Instant(java.time.Instant) MessageHelper(org.eclipse.hono.util.MessageHelper) RequestResponseApiConstants(org.eclipse.hono.util.RequestResponseApiConstants) Collectors(java.util.stream.Collectors) EventConstants(org.eclipse.hono.util.EventConstants) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) AsyncHandlingAutoCommitKafkaConsumer(org.eclipse.hono.client.kafka.consumer.AsyncHandlingAutoCommitKafkaConsumer) Objects(java.util.Objects) Base64(java.util.Base64) List(java.util.List) KafkaProducerFactory(org.eclipse.hono.client.kafka.producer.KafkaProducerFactory) Buffer(io.vertx.core.buffer.Buffer) MessageProperties(org.eclipse.hono.application.client.MessageProperties) Optional(java.util.Optional) Checkpoint(io.vertx.junit5.Checkpoint) Queue(java.util.Queue) VertxTestContext(io.vertx.junit5.VertxTestContext) HttpResponse(io.vertx.ext.web.client.HttpResponse) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Credentials(org.eclipse.hono.service.management.credentials.Credentials) HashMap(java.util.HashMap) OptionalInt(java.util.OptionalInt) Function(java.util.function.Function) Constants(org.eclipse.hono.util.Constants) TimeUntilDisconnectNotification(org.eclipse.hono.util.TimeUntilDisconnectNotification) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) KafkaAdminClientConfigProperties(org.eclipse.hono.client.kafka.KafkaAdminClientConfigProperties) LinkedList(java.util.LinkedList) HonoConnection(org.eclipse.hono.client.HonoConnection) CommandConstants(org.eclipse.hono.util.CommandConstants) ProducerConfig(org.apache.kafka.clients.producer.ProducerConfig) RegistryManagementConstants(org.eclipse.hono.util.RegistryManagementConstants) Strings(org.eclipse.hono.util.Strings) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) Promise(io.vertx.core.Promise) KafkaApplicationClientImpl(org.eclipse.hono.application.client.kafka.impl.KafkaApplicationClientImpl) Vertx(io.vertx.core.Vertx) Truth.assertThat(com.google.common.truth.Truth.assertThat) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) HonoTopic(org.eclipse.hono.client.kafka.HonoTopic) JsonArray(io.vertx.core.json.JsonArray) MessageConsumer(org.eclipse.hono.application.client.MessageConsumer) SendMessageTimeoutException(org.eclipse.hono.client.SendMessageTimeoutException) SendMessageSampler(org.eclipse.hono.client.SendMessageSampler) NoopSpan(io.opentracing.noop.NoopSpan) GenericSenderLink(org.eclipse.hono.client.amqp.GenericSenderLink) Handler(io.vertx.core.Handler) PasswordCredential(org.eclipse.hono.service.management.credentials.PasswordCredential) KafkaAdminClient(io.vertx.kafka.admin.KafkaAdminClient) KafkaAdminClient(io.vertx.kafka.admin.KafkaAdminClient) Instant(java.time.Instant) HonoTopic(org.eclipse.hono.client.kafka.HonoTopic) LinkedList(java.util.LinkedList) List(java.util.List) LinkedList(java.util.LinkedList) KeyPair(java.security.KeyPair) Pair(org.eclipse.hono.util.Pair)

Example 2 with Pair

use of org.eclipse.hono.util.Pair in project hono by eclipse.

the class LoraProtocolAdapter method handleCommand.

private void handleCommand(final CommandContext commandContext) {
    Tags.COMPONENT.set(commandContext.getTracingSpan(), getTypeName());
    final Sample timer = metrics.startTimer();
    final Command command = commandContext.getCommand();
    if (command.getGatewayId() == null) {
        final String errorMsg = "no gateway defined for command";
        LOG.debug("{} [{}]", errorMsg, command);
        commandContext.release(new ServerErrorException(HttpURLConnection.HTTP_UNAVAILABLE, errorMsg));
        return;
    }
    final String tenant = command.getTenant();
    final String gatewayId = command.getGatewayId();
    final LoraProvider loraProvider = Optional.ofNullable(commandSubscriptions.get(new SubscriptionKey(tenant, gatewayId))).map(Pair::two).orElse(null);
    if (loraProvider == null) {
        LOG.debug("received command for unknown gateway [{}] for tenant [{}]", gatewayId, tenant);
        TracingHelper.logError(commandContext.getTracingSpan(), String.format("received command for unknown gateway [%s]", gatewayId));
        commandContext.release(new ServerErrorException(HttpURLConnection.HTTP_UNAVAILABLE, "received command for unknown gateway"));
        return;
    }
    final Future<TenantObject> tenantTracker = getTenantConfiguration(tenant, commandContext.getTracingContext());
    tenantTracker.compose(tenantObject -> {
        if (command.isValid()) {
            return checkMessageLimit(tenantObject, command.getPayloadSize(), commandContext.getTracingContext());
        } else {
            return Future.failedFuture(new ClientErrorException(HttpURLConnection.HTTP_BAD_REQUEST, "malformed command message"));
        }
    }).compose(success -> getRegistrationClient().assertRegistration(tenant, gatewayId, null, commandContext.getTracingContext())).compose(registrationAssertion -> sendCommandToGateway(commandContext, loraProvider, registrationAssertion.getCommandEndpoint())).onSuccess(aVoid -> {
        addMicrometerSample(commandContext, timer);
        commandContext.accept();
        metrics.reportCommand(command.isOneWay() ? Direction.ONE_WAY : Direction.REQUEST, tenant, tenantTracker.result(), MetricsTags.ProcessingOutcome.FORWARDED, command.getPayloadSize(), timer);
    }).onFailure(t -> {
        LOG.debug("error sending command", t);
        commandContext.release(t);
        metrics.reportCommand(command.isOneWay() ? Direction.ONE_WAY : Direction.REQUEST, tenant, tenantTracker.result(), MetricsTags.ProcessingOutcome.from(t), command.getPayloadSize(), timer);
    });
}
Also used : HttpURLConnection(java.net.HttpURLConnection) LoraProviderMalformedPayloadException(org.eclipse.hono.adapter.lora.providers.LoraProviderMalformedPayloadException) LoggerFactory(org.slf4j.LoggerFactory) Router(io.vertx.ext.web.Router) Tag(io.opentracing.tag.Tag) RoutingContext(io.vertx.ext.web.RoutingContext) Tags(io.opentracing.tag.Tags) Map(java.util.Map) Pair(org.eclipse.hono.util.Pair) Fields(io.opentracing.log.Fields) JsonObject(io.vertx.core.json.JsonObject) TracingHelper(org.eclipse.hono.tracing.TracingHelper) TenantServiceBasedX509Authentication(org.eclipse.hono.adapter.auth.device.TenantServiceBasedX509Authentication) ChainAuthHandler(io.vertx.ext.web.handler.ChainAuthHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CommandContext(org.eclipse.hono.client.command.CommandContext) MetricsTags(org.eclipse.hono.service.metric.MetricsTags) Message(io.vertx.core.eventbus.Message) EventConstants(org.eclipse.hono.util.EventConstants) StringTag(io.opentracing.tag.StringTag) Future(io.vertx.core.Future) HonoBasicAuthHandler(org.eclipse.hono.adapter.http.HonoBasicAuthHandler) Device(org.eclipse.hono.auth.Device) Objects(java.util.Objects) List(java.util.List) Buffer(io.vertx.core.buffer.Buffer) X509AuthHandler(org.eclipse.hono.adapter.http.X509AuthHandler) CommandConsumer(org.eclipse.hono.client.command.CommandConsumer) Optional(java.util.Optional) Span(io.opentracing.Span) UsernamePasswordCredentials(org.eclipse.hono.adapter.auth.device.UsernamePasswordCredentials) CommandEndpoint(org.eclipse.hono.util.CommandEndpoint) HttpContext(org.eclipse.hono.service.http.HttpContext) Json(io.vertx.core.json.Json) LoraProvider(org.eclipse.hono.adapter.lora.providers.LoraProvider) WebClient(io.vertx.ext.web.client.WebClient) Command(org.eclipse.hono.client.command.Command) ClientErrorException(org.eclipse.hono.client.ClientErrorException) TenantDisabledOrNotRegisteredException(org.eclipse.hono.client.registry.TenantDisabledOrNotRegisteredException) Constants(org.eclipse.hono.util.Constants) ArrayList(java.util.ArrayList) TracingHandler(org.eclipse.hono.service.http.TracingHandler) CompositeFuture(io.vertx.core.CompositeFuture) StatusCodeMapper(org.eclipse.hono.client.StatusCodeMapper) HttpUtils(org.eclipse.hono.service.http.HttpUtils) LinkedList(java.util.LinkedList) UsernamePasswordAuthProvider(org.eclipse.hono.adapter.auth.device.UsernamePasswordAuthProvider) Logger(org.slf4j.Logger) Direction(org.eclipse.hono.service.metric.MetricsTags.Direction) AbstractVertxBasedHttpProtocolAdapter(org.eclipse.hono.adapter.http.AbstractVertxBasedHttpProtocolAdapter) Promise(io.vertx.core.Promise) ServerErrorException(org.eclipse.hono.client.ServerErrorException) Sample(io.micrometer.core.instrument.Timer.Sample) TenantObject(org.eclipse.hono.util.TenantObject) SpanContext(io.opentracing.SpanContext) HttpRequest(io.vertx.ext.web.client.HttpRequest) DeviceCredentialsAuthProvider(org.eclipse.hono.adapter.auth.device.DeviceCredentialsAuthProvider) X509AuthProvider(org.eclipse.hono.adapter.auth.device.X509AuthProvider) HttpMethod(io.vertx.core.http.HttpMethod) HttpProtocolAdapterProperties(org.eclipse.hono.adapter.http.HttpProtocolAdapterProperties) SubjectDnCredentials(org.eclipse.hono.adapter.auth.device.SubjectDnCredentials) TenantObject(org.eclipse.hono.util.TenantObject) LoraProvider(org.eclipse.hono.adapter.lora.providers.LoraProvider) Command(org.eclipse.hono.client.command.Command) Sample(io.micrometer.core.instrument.Timer.Sample) ClientErrorException(org.eclipse.hono.client.ClientErrorException) ServerErrorException(org.eclipse.hono.client.ServerErrorException)

Example 3 with Pair

use of org.eclipse.hono.util.Pair in project hono by eclipse.

the class CommandRouterServiceImpl method activateCommandRouting.

private void activateCommandRouting(final Pair<String, Integer> attempt, final SpanContext tracingContext) {
    if (!running.get()) {
        // component has been stopped, no need to create command consumer in this case
        tenantsInProcess.remove(attempt.one());
        return;
    }
    final Span span = tracer.buildSpan("re-enable command routing for tenant").addReference(References.FOLLOWS_FROM, tracingContext).withTag(TracingHelper.TAG_TENANT_ID, attempt.one()).start();
    final var logEntries = new HashMap<String, Object>(2);
    logEntries.put("attempt#", attempt.two());
    tenantClient.get(attempt.one(), span.context()).map(tenantObject -> commandConsumerFactoryProvider.getClient(tenantObject)).map(factory -> factory.createCommandConsumer(attempt.one(), span.context())).onSuccess(ok -> {
        logEntries.put(Fields.MESSAGE, "successfully created command consumer");
        span.log(logEntries);
        reenabledTenants.add(attempt.one());
    }).onFailure(t -> {
        logEntries.put(Fields.MESSAGE, "failed to create command consumer");
        logEntries.put(Fields.ERROR_OBJECT, t);
        TracingHelper.logError(span, logEntries);
        if (t instanceof ServerErrorException) {
            // add to end of queue in order to retry at a later time
            LOG.info("failed to create command consumer [attempt#: {}]", attempt.two(), t);
            span.log("marking tenant for later re-try to create command consumer");
            tenantsToEnable.addLast(Pair.of(attempt.one(), attempt.two() + 1));
        }
    }).onComplete(r -> {
        span.finish();
        tenantsInProcess.remove(attempt.one());
        processTenantQueue(tracingContext);
    });
}
Also used : HttpURLConnection(java.net.HttpURLConnection) CommandRouterService(org.eclipse.hono.service.commandrouter.CommandRouterService) Lifecycle(org.eclipse.hono.util.Lifecycle) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) Deque(java.util.Deque) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) ServiceConfigProperties(org.eclipse.hono.config.ServiceConfigProperties) Context(io.vertx.core.Context) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) Status(io.vertx.ext.healthchecks.Status) MessagingType(org.eclipse.hono.util.MessagingType) HealthCheckHandler(io.vertx.ext.healthchecks.HealthCheckHandler) DeviceRegistrationClient(org.eclipse.hono.client.registry.DeviceRegistrationClient) HealthCheckProvider(org.eclipse.hono.service.HealthCheckProvider) References(io.opentracing.References) Duration(java.time.Duration) Map(java.util.Map) Pair(org.eclipse.hono.util.Pair) Fields(io.opentracing.log.Fields) TracingHelper(org.eclipse.hono.tracing.TracingHelper) LinkedList(java.util.LinkedList) CommandRouterResult(org.eclipse.hono.service.commandrouter.CommandRouterResult) Logger(org.slf4j.Logger) Tracer(io.opentracing.Tracer) MessagingClientProvider(org.eclipse.hono.client.util.MessagingClientProvider) Vertx(io.vertx.core.Vertx) Set(java.util.Set) ServerErrorException(org.eclipse.hono.client.ServerErrorException) TenantClient(org.eclipse.hono.client.registry.TenantClient) Future(io.vertx.core.Future) DeviceConnectionInfo(org.eclipse.hono.deviceconnection.infinispan.client.DeviceConnectionInfo) SpanContext(io.opentracing.SpanContext) Objects(java.util.Objects) List(java.util.List) ServiceClient(org.eclipse.hono.client.util.ServiceClient) CommandConsumerFactory(org.eclipse.hono.commandrouter.CommandConsumerFactory) Span(io.opentracing.Span) AdapterInstanceStatusService(org.eclipse.hono.commandrouter.AdapterInstanceStatusService) HashMap(java.util.HashMap) ServerErrorException(org.eclipse.hono.client.ServerErrorException) Span(io.opentracing.Span)

Example 4 with Pair

use of org.eclipse.hono.util.Pair in project hono by eclipse.

the class HonoKafkaConsumer method subscribeAndWaitForRebalance.

private Future<Void> subscribeAndWaitForRebalance() {
    if (stopCalled.get()) {
        return Future.failedFuture(new ServerErrorException(HttpURLConnection.HTTP_UNAVAILABLE, "already stopped"));
    }
    final Promise<Void> partitionAssignmentDone = Promise.promise();
    final Promise<Void> subscriptionUpdated = Promise.promise();
    final Pair<Promise<Void>, Promise<Void>> newPromisePair = Pair.of(subscriptionUpdated, partitionAssignmentDone);
    final var promisePair = subscriptionUpdatedAndPartitionsAssignedPromiseRef.updateAndGet(promise -> promise == null ? newPromisePair : promise);
    if (!promisePair.equals(newPromisePair)) {
        log.debug("subscribeAndWaitForRebalance: will wait for ongoing invocation to complete");
        return CompositeFuture.all(promisePair.one().future(), promisePair.two().future()).mapEmpty();
    }
    if (topicPattern != null) {
        kafkaConsumer.subscribe(topicPattern, subscriptionUpdated);
    } else {
        // Trigger retrieval of metadata for each of the subscription topics if not already available locally;
        // this will also trigger topic auto-creation if the topic doesn't exist yet.
        // Doing so before the "subscribe" invocation shall ensure that these partitions are considered for
        // partition assignment.
        topics.forEach(topic -> HonoKafkaConsumerHelper.partitionsFor(kafkaConsumer, topic).onSuccess(partitions -> {
            if (partitions.isEmpty()) {
                log.info("subscription topic doesn't exist and didn't get auto-created: {} [client-id: {}]", topic, getClientId());
            }
        }));
        kafkaConsumer.subscribe(topics, subscriptionUpdated);
    }
    // init kafkaConsumerWorker if needed; it has to be retrieved after the first "subscribe" invocation
    if (kafkaConsumerWorker == null) {
        kafkaConsumerWorker = getKafkaConsumerWorker(kafkaConsumer);
    }
    vertx.setTimer(WAIT_FOR_REBALANCE_TIMEOUT_MILLIS, ar -> {
        if (!partitionAssignmentDone.future().isComplete()) {
            subscriptionUpdatedAndPartitionsAssignedPromiseRef.compareAndSet(promisePair, null);
            final String errorMsg = "timed out waiting for rebalance and update of subscribed topics";
            log.warn(errorMsg);
            partitionAssignmentDone.tryFail(new ServerErrorException(HttpURLConnection.HTTP_UNAVAILABLE, errorMsg));
        }
    });
    subscriptionUpdated.future().onFailure(thr -> {
        subscriptionUpdatedAndPartitionsAssignedPromiseRef.compareAndSet(promisePair, null);
    });
    return CompositeFuture.all(subscriptionUpdated.future(), partitionAssignmentDone.future()).mapEmpty();
}
Also used : HttpURLConnection(java.net.HttpURLConnection) Lifecycle(org.eclipse.hono.util.Lifecycle) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) RegisterForReflection(io.quarkus.runtime.annotations.RegisterForReflection) KafkaConsumerRecords(io.vertx.kafka.client.consumer.KafkaConsumerRecords) AtomicReference(java.util.concurrent.atomic.AtomicReference) Supplier(java.util.function.Supplier) KafkaClientFactory(org.eclipse.hono.client.kafka.KafkaClientFactory) Context(io.vertx.core.Context) HashSet(java.util.HashSet) CompositeFuture(io.vertx.core.CompositeFuture) Helper(io.vertx.kafka.client.common.impl.Helper) KafkaClientMetricsSupport(org.eclipse.hono.client.kafka.metrics.KafkaClientMetricsSupport) Duration(java.time.Duration) Map(java.util.Map) Pair(org.eclipse.hono.util.Pair) KafkaReadStreamImpl(io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl) LinkedList(java.util.LinkedList) ExecutorService(java.util.concurrent.ExecutorService) Consumer(org.apache.kafka.clients.consumer.Consumer) Futures(org.eclipse.hono.util.Futures) Logger(org.slf4j.Logger) Collection(java.util.Collection) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) Set(java.util.Set) ServerErrorException(org.eclipse.hono.client.ServerErrorException) ConsumerConfig(org.apache.kafka.clients.consumer.ConsumerConfig) UUID(java.util.UUID) KafkaRecordHelper(org.eclipse.hono.client.kafka.KafkaRecordHelper) Field(java.lang.reflect.Field) Collectors(java.util.stream.Collectors) Future(io.vertx.core.Future) TopicPartition(io.vertx.kafka.client.common.TopicPartition) Objects(java.util.Objects) TimeUnit(java.util.concurrent.TimeUnit) ConsumerRebalanceListener(org.apache.kafka.clients.consumer.ConsumerRebalanceListener) List(java.util.List) Stream(java.util.stream.Stream) Metrics(org.apache.kafka.common.metrics.Metrics) Buffer(io.vertx.core.buffer.Buffer) CooperativeStickyAssignor(org.apache.kafka.clients.consumer.CooperativeStickyAssignor) KafkaConsumerRecord(io.vertx.kafka.client.consumer.KafkaConsumerRecord) Optional(java.util.Optional) KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer) Pattern(java.util.regex.Pattern) Handler(io.vertx.core.Handler) Promise(io.vertx.core.Promise) ServerErrorException(org.eclipse.hono.client.ServerErrorException)

Aggregations

CompositeFuture (io.vertx.core.CompositeFuture)4 Future (io.vertx.core.Future)4 HttpURLConnection (java.net.HttpURLConnection)4 LinkedList (java.util.LinkedList)4 List (java.util.List)4 Map (java.util.Map)4 Objects (java.util.Objects)4 Promise (io.vertx.core.Promise)3 Vertx (io.vertx.core.Vertx)3 Buffer (io.vertx.core.buffer.Buffer)3 HashSet (java.util.HashSet)3 Optional (java.util.Optional)3 Set (java.util.Set)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 ServerErrorException (org.eclipse.hono.client.ServerErrorException)3 Pair (org.eclipse.hono.util.Pair)3 Logger (org.slf4j.Logger)3 LoggerFactory (org.slf4j.LoggerFactory)3 Span (io.opentracing.Span)2 SpanContext (io.opentracing.SpanContext)2