Class TenantPropagationHttpClientFilter
java.lang.Object
io.micronaut.multitenancy.propagation.TenantPropagationHttpClientFilter
- All Implemented Interfaces:
- io.micronaut.core.order.Ordered,- io.micronaut.http.filter.HttpClientFilter,- io.micronaut.http.filter.HttpFilter
@Filter("${micronaut.multitenancy.propagation.path:/**}")
@Requires(beans={TenantWriter.class,TenantResolver.class,TenantPropagationConfiguration.class,io.micronaut.http.util.OutgoingHttpRequestProcessor.class}) @Requires(property="micronaut.multitenancy.propagation.enabled")
public class TenantPropagationHttpClientFilter
extends Object
implements io.micronaut.http.filter.HttpClientFilter
HttpClientFilter to enable Token propagation.- Since:
- 1.0
- Author:
- Sergio del Amo
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final io.micronaut.http.util.OutgoingHttpRequestProcessorUtility to decide whether to process the request.protected final TenantPropagationConfigurationTenant Propagation Configuration.protected final TenantResolverBean responsible for resolving the tenant.protected final TenantWriterbean responsible for writing the tenant to the target request.Fields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionTenantPropagationHttpClientFilter(TenantResolver tenantResolver, TenantWriter tokenWriter, TenantPropagationConfiguration tenantPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>>doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest, io.micronaut.http.filter.ClientFilterChain chain) If the request should be processed and the tenant id is resolved, the tenant is written to the targeted request with aTenantWriter.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.filter.HttpClientFilterdoFilterMethods inherited from interface io.micronaut.core.order.OrderedgetOrder
- 
Field Details- 
tenantPropagationConfigurationTenant Propagation Configuration.
- 
tokenWriterbean responsible for writing the tenant to the target request.
- 
tenantResolverBean responsible for resolving the tenant.
- 
outgoingHttpRequestProcessorprotected final io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessorUtility to decide whether to process the request.
 
- 
- 
Constructor Details- 
TenantPropagationHttpClientFilterpublic TenantPropagationHttpClientFilter(TenantResolver tenantResolver, TenantWriter tokenWriter, TenantPropagationConfiguration tenantPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor) - Parameters:
- tenantResolver- bean responsible for resolving the tenant
- tokenWriter- bean responsible for writing the token to the target request
- tenantPropagationConfiguration- Tenant Propagation configuration
- outgoingHttpRequestProcessor- Utility to decide whether to process the request
 
 
- 
- 
Method Details- 
doFilterpublic org.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>> doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest, io.micronaut.http.filter.ClientFilterChain chain) If the request should be processed and the tenant id is resolved, the tenant is written to the targeted request with aTenantWriter.- Specified by:
- doFilterin interface- io.micronaut.http.filter.HttpClientFilter
- Parameters:
- targetRequest- The target request
- chain- The filter chain
- Returns:
- The publisher of the response
 
 
-