RED-4646: Added request interceptor that sends x-tenant-id on each client call
This commit is contained in:
parent
7b00edc2d3
commit
27c636fb36
@ -0,0 +1,18 @@
|
||||
package com.iqser.red.service.search.v1.server.multitenancy;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
|
||||
@Component
|
||||
public class ForwardTenantInterceptor implements RequestInterceptor {
|
||||
|
||||
public static final String TENANT_HEADER_NAME = "X-TENANT-ID";
|
||||
|
||||
@Override
|
||||
public void apply(RequestTemplate template) {
|
||||
// do something
|
||||
template.header(TENANT_HEADER_NAME, TenantContext.getTenantId());
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user