How to debug Quarkus producer method - Stack Overflow
I have a producer class which looks like this (SomeBean is here interface):
@ApplicationScoped
@JBossLog
public class DocumentCreatorFactory {
@Produces
@ApplicationScoped
public List<SomeBean> getSomeBeans(@Any Instance<SomeBean> someBeans) {
log.infof("######### Producer started: %d #########", documentCreators.stream().count());
return someBeans.select(
TagContext.Literal.of(Tag.CORE, Tag.CH)
).stream().toList();
}
}
TagContext annotation looks as follows:
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
public @interface TagContext {
Tag[] value() default {Tag.CORE};
final class Literal extends AnnotationLiteral<TagContext> implements TagContext {
private final Tag[] value;
public static Literal of(Tag... value) {
return new Literal(value);
}
private Literal(Tag... value) {
this.value = value;
}
@Override
public Tag[] value() {
return value;
}
}
}
Beans look like following:
@TagContext({Tag.CORE, Tag.CH})
@ApplicationScoped
@JBossLog
public class TagCoreAndChService implements SomeBean {
@Override
public void create() {
log.infof("Core And Ch Some Bean Create");
}
}
@TagContext
@ApplicationScoped
@JBossLog
public class TagCoreService implements SomeBean {
@Override
public void create() {
log.infof("Core And Ch Some Bean Create");
}
}
Why don't I get nothing written out on the console (logging) and I also can not debug this code inside Intellij?
SomeBean classes are being used in the following way:
@ApplicationScoped
@JBossLog
public class SomeBeanService {
@Inject Instance<SomeBean> someBeans;
@Inject @Any Instance<SomeBean> allSomeBeans;
public void someProcessing(String inParam) {
// When we inspect count there is no bean found
log.infof("Num of beans: %d", someBeans.stream().count());
Instance<DocumentCreator> core = allSomeBeans.select(
Literal.of(Tag.CORE, Tag.CH)
);
// When we do this inside of the method we find some beans
log.infof("Num of beans AFTER: %d", core.stream().count());
}
}
最新文章
- .NET开源:微软"云为先"战略的全面铺开
- 大本营不保?美国安卓系统激活量超iOS
- 2012年NEC云时代平台软件全国巡展启动
- 常受电脑辐射的白领男易生闺女?
- reactjs - CORS issue from React to Flask - Stack Overflow
- apache beam - Unable to Write processed Data to Parquet - Stack Overflow
- open source - Langgraph State not being passed properly with Ollama - Stack Overflow
- Prisma create: Typescript error in field data - Stack Overflow
- Parsing Swift Predicates into Database Statements with PredicateExpressions - Stack Overflow
- amazon web services - Problem with eventbridge when scheduling a rule - Stack Overflow
- c - sorry, unimplemented: Thumb-1 ‘hard-float’ VFP ABI - arm-linux-gnueabihf-gcc - targeting armv6 - Stack Overflow
- python - Wrap_lon of the regionmask does not work with data span from -180 to 180 - Stack Overflow
- c++ - Which option has precendence if I enable and disable FrontEndHeapDebugOptions at the same time? - Stack Overflow
- reactjs - How to deploy Laravel (with react) app on heroku without any error (like 419 error) - Stack Overflow
- rust - Remove struct from vector while mutably iterating through it - Stack Overflow
- flutter - How to adjust code formatting when formatting the document - Stack Overflow
- javascript - React Leaflet custom marker with NextJS window undefined - Stack Overflow