我有一个 eventhub,我正在向它发送数据。现在我需要接收该数据。所以我按照 eventhub 页面中的教程进行操作
https://azure.microsoft.com/en-us/documentation/articles/event-hubs-java-ephjava-getstarted/
“使用 Java 中的 EventProcessorHost 接收消息”
在所有类(class)中,它都不让我 @覆盖。它给了我以下错误。
Multiple markers at this line
- implements com.microsoft.azure.eventprocessorhost.IEventProcessor.onOpen
- The method onOpen(PartitionContext) of type EventProcessor must override a superclass
我已经添加了pom中指定的依赖项(我使用的是maven项目)。
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-eventhubs</artifactId>
<version>0.7.2</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-eventhubs-eph</artifactId>
<version>0.7.2</version>
</dependency>
</dependencies>
最佳答案
将项目引用更改为指向 jdk1.8。
当您尝试使用 jdk1.5 编译 Java 项目时,这是一个非常常见的错误。
@Override
注解的规范从 jdk1.5 到 jdk1.6 发生了变化。
呵呵!
关于java - 在 Azure Eventhub 中,当使用 Java 中的 EventProcessorHost 接收消息时 @Override 出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38466353/