我正在尝试使用 spring-cloud-aws-messaging 手动删除 AWS SQS 消息来实现逻辑。此功能是在测试示例中的此票证 范围内实现的
@SqsListener(value = "queueName", deletionPolicy = SqsMessageDeletionPolicy.NEVER)
public void listen(SqsEventDTO message, Acknowledgment acknowledgment) {
LOGGER.info("Received message {}", message.getFoo());
try {
acknowledgment.acknowledge().get();
} catch (InterruptedException e) {
LOGGER.error("Opps", e);
} catch (ExecutionException e) {
LOGGER.error("Opps", e);
}
}
Run Code Online (Sandbox Code Playgroud)
但面对意外的异常
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance oforg.springframework.cloud.aws.messaging.listener.Acknowledgement(no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
解决方案SqsMessageDeletionPolicy.ON_SUCCESS有效,但我想避免抛出异常。 …
我试图了解弹簧5的反应部分.我创建了简单的休止端点,用于使用弹簧web-flux和弹簧数据反应(mongo)查找所有实体,但是没有看到任何方式如何实现分页.
这是我在Kotlin的简单例子:
@GetMapping("/posts/")
fun getAllPosts() = postRepository.findAll()
Run Code Online (Sandbox Code Playgroud)
这是否意味着被动端点不需要分页?是否有一些方法可以使用此堆栈从服务器端实现分页?
现在我正在搜索Quartz库中按作业名称获取作业键的功能.
我看到Scheduler有方法,通过组名称中使用获得作业键GroupMatcher<JobKey>也Quartz有NameMatcher它可以是用户的方式相同GroupMatcher
Set<JobKey> getJobKeys(NameMatcher<JobKey> matcher) throws SchedulerException;
Run Code Online (Sandbox Code Playgroud)
您知道Quartz库中是否已存在此功能?