我试图使用deq_condition (在中)将具有特定优先级的消息排出队列,但始终找不到消息。我尝试了以下几点:
dequeue_options.deq_condition := 'tab.priority = 10';
dequeue_options.deq_condition := 'priority = 10'; 我也试图回到这样一个真实的状态:
dequeue_options.deq_condition := '1 = 1'; 但是总是找不到消息,如果我删除了这个条件,就会得到排队的消息。知道吗?
发布于 2019-02-26 19:27:51
简单地检查队列中是否是具有给定优先级的消息。将aqtab替换为队列表名称
select * from aqtab where priority = 10 order by ENQ_TIME;很可能您不会看到messege,因为这个条件priority = 10很简单地添加到执行去队列的查询中。
注意,若要设置使用message属性的消息优先级,请注意
l_message_properties dbms_aq.message_properties_t;简单地指定所需的优先级..。
l_message_properties.priority := 10;..。并将属性作为参数传递给DBMS_AQ.enqueue。
在commit之后,您应该可以使用上面的查询在队列表中看到消息,并且您应该能够使用deq_condition来对它进行排列。
发布于 2019-02-26 12:33:45
两个版本都是正确的。
dequeue_options.deq_condition := 'priority = 10';
dequeue_options.deq_condition := 'tab.priority = 10';
但是,如果您使用的是deq条件,您应该注意navigation参数。最简单的选项是在出现异常后重复去队列操作。(队列快照将被重新设置)。
或者添加dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;。
https://stackoverflow.com/questions/54883955
复制相似问题