All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.reactive.messaging.amqp.tracing.AmqpMessageTextMapGetter Maven / Gradle / Ivy

There is a newer version: 4.25.0
Show newest version
package io.smallrye.reactive.messaging.amqp.tracing;

import java.util.Collections;

import io.opentelemetry.context.propagation.TextMapGetter;
import io.smallrye.reactive.messaging.amqp.AmqpMessage;
import io.vertx.core.json.JsonObject;

public enum AmqpMessageTextMapGetter implements TextMapGetter> {
    INSTANCE;

    @Override
    public Iterable keys(final AmqpMessage carrier) {
        JsonObject applicationProperties = carrier.getApplicationProperties();
        return applicationProperties != null ? applicationProperties.fieldNames() : Collections.emptyList();
    }

    public String get(final AmqpMessage carrier, final String key) {
        JsonObject applicationProperties = carrier.getApplicationProperties();
        return applicationProperties != null ? applicationProperties.getString(key) : null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy