Vert.x @ConsumeEvent 使用正则表达式

huangapple go评论112阅读模式
英文:

Vert.x @ConsumeEvent with regex

问题

我正在使用这个来消费保留给"telemetry-feed-1"的事件。我在Quarkus中使用"io.quarkus.vertx.ConsumeEvent"。我想要使用类似"telemetry-feed-.*"的正则表达式来预订以"telemetry-feed-"开头的任何通道。有谁知道我如何做到这一点。非常感谢。

@ConsumeEvent("telemetry-feed-1")
public void publishMatchingSubscriptions(String message) throws Exception {
   // 处理数据
}
英文:

I am using this to consume events reserved to "telemetry-feed-1". I am using "io.quarkus.vertx.ConsumeEvent" with quarkus. I want to use regEx like "telemetry-feed-.*" to reserve any channel that start with "telemetry-feed-". any one know how I can do this. Thank you very much.

@ConsumeEvent("telemetry-feed-1" )
public void publishMatchingSubscriptions(String message) throws Exception {
   // process data
}

答案1

得分: 2

@ConsumeEvent注解在Quarkus中只是为了更方便使用io.vertx.core.eventbus.EventBus,因为后者不支持正则表达式,所以该注解也不支持。

英文:

The @ConsumeEvent annotation in Quarkus just makes the use of io.vertx.core.eventbus.EventBus easier and since the latter does not support regex, neither does the annotation

huangapple
  • 本文由 发表于 2023年1月9日 19:20:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75056541.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定