pl.allegro.tech.hermes.consumers.consumer.sender.resolver.InterpolatingEndpointAddressResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.consumers.consumer.sender.resolver;
import pl.allegro.tech.hermes.api.EndpointAddress;
import pl.allegro.tech.hermes.api.EndpointAddressResolverMetadata;
import pl.allegro.tech.hermes.consumers.consumer.Message;
import pl.allegro.tech.hermes.consumers.consumer.interpolation.InterpolationException;
import pl.allegro.tech.hermes.consumers.consumer.interpolation.UriInterpolator;
import java.net.URI;
public class InterpolatingEndpointAddressResolver implements EndpointAddressResolver {
private final UriInterpolator interpolator;
public InterpolatingEndpointAddressResolver(UriInterpolator interpolator) {
this.interpolator = interpolator;
}
@Override
public URI resolve(EndpointAddress address, Message message, EndpointAddressResolverMetadata metadata)
throws EndpointAddressResolutionException {
try {
return interpolator.interpolate(address, message);
} catch (InterpolationException ex) {
throw new EndpointAddressResolutionException(address, ex);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy