Closed 313hemant313 closed 9 months ago
Do you have an example for this in spring boot?
Sample meta annotation example:
@Target(ElementType.TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface QueryRequest {
}
@Target(ElementType.ANNOTATION_TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@QueryRequest
@interface NextQueryRequest
@Target(ElementType.ANNOTATION_TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface QueryRequest {
}
@Target(ElementType.ANNOTATION_TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@QueryRequest
@interface NextQueryRequest
@GrpcClient annotation is does not have Target as ElementType.ANNOTATION_TYPE
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface GrpcClient
If that is all that is needed, I would say: Contributions welcome.
As of now it is not possible to create a meta annotation with @GrpcClient("client-key").
@GrpcClient("client-key-profile-1") SameTypeStub stub
@GrpcClient("cient-key-profile-1") SameTypeStub stub
we have a requirement where based on some logic we can switch between stub of same type but with different profile (different address)
So was thinking for creating a meta annotation so that we can keep a annotation like
@CustomGrpcClient("client-key-profile-1", "PROFILE-1") @CustomGrpcClient("client-key-profile-1", "PROFILE-2")