如何在micronaut中创建自定义注释?

时间:2019-02-19 08:57:25

标签: micronaut

如何像在春天的@JmsListener一样在micronaut中创建自定义注释并为其实现逻辑?

@Component
public class ArtemisCusumer {

    @JmsListener(destination = "someQueue")
    public void processMessage(String content) throws Exception {
        System.out.println("recivemessage:"+content);
        throw new Exception("not ok");
    }

    @JmsListener(destination = "DLQ")
    public void dlq(String content) throws Exception {
        System.out.println("dlq:"+content);
    }

}

1 个答案:

答案 0 :(得分:0)