Thursday, September 12, 2019

12c SOA - Advance Queue - what is Dequeue Condition and how to configure it.

What is Dequeue Condition:
  • Dequeue Condition allows to filter the messages that a Message Consumer will receive.
  • When a dequeue is performed from a multi consumer queue, it is sometimes necessary to screen the messages and accept only those that meet certain conditions. These conditions can be based on payload or queue header values and is specified using DequeueCondition property of the AQ adapter. 
How to configure Dequeue Condition :
When configuring the Dequeue AQ in jdeveloper, you will find the below screen where you will provide correlation id and dequeue condition.
Enter a Boolean expression similar to the WHERE clause of a SQL query. This expression can include conditions on message properties, user data properties (object payloads only), and PL/SQL or SQL functions.

Dequeue Condition
The format for the condition to use:
tab.user_data.field_name = 'some value to be matched'

In JCA file condition looks like below:
<property name="DequeueCondition" value="tab.user_data.ITEM_PUBLISHER = 'ABP'"/>

Following the object type used and based on the field ITEM_PUBLISHER, I want to filter and dequeue the messages.
CREATE OR REPLACE TYPE ITEM_TYPE AS OBJECT (
ITEM_ID NUMBER(4),
ITEM_NAME VARCHAR2(30),
ITEM_PUBLISHER VARCHAR2(30)
);

If you want to know how to create AQ adapter enqueue and dequeue step by step, click here oracle-12c-aq-adapter-enqueue-and-dequeue.



No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...