如何检查JMS侦听器是否处于活动状态?

时间:2020-10-05 00:14:58

标签: jms listener spring-jms

我构建了一个JMS侦听器来指向SQS队列,并且已经向该队列发送了消息,但是不幸的是,它们并没有从队列中被接收。如何检查以确保侦听器处于活动状态并准备接受新消息。为了清楚起见,下面是去除不必要部分的代码:

@Component
@Conditional(SqsListeningEnabledCondition.class)
public class SqsJobListener {

    private static final Logger logger = LoggerFactory.getLogger(SqsJobListener.class);
    private final ObjectMapper objectMapper;
    private final JobFactoryMap jobFactoryMap;
    private final CacheManager cacheManager;

    @Autowired
    public SqsJobListener() {
    }

    @JmsListener(destination = "${aws.job.queue}", containerFactory = "customListenerContainerFactory", concurrency = "1")
    public void receiveIngestionMessage(String message) {

       //deserializing bits here
    }

}

0 个答案:

没有答案