Oracle Error ORA-25212: invalid PRIORITY specified when using sequence deviation

Oracle Error Message

ORA-25212: invalid PRIORITY specified when using sequence deviation

Reason for the Error

The PRIORITY specified in the enqueue is less than the priority of the message with the given relative message id.

Solution

Set the PRIORITY to be less than the delay of the message with the given relative message id. If the TOP option is used the prioirty must be greater than or equal to the priority of all the messages in the queue.