- max_retries
- retry_delay
They can be configured at queue creation time (DBMS_AQADM.CREATE_QUEUE) or can be updated in a existent queue (DBMS_AQADM.ALTER_QUEUE). The default values are 5 for max_retries and 0 for retry (as soon as possible). The complete set of parameters can be found here.
In Weblogic, you can verify the parameter's operation with something like this:
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "ConnectionFactoryJndiName", propertyValue = "..."),
@ActivationConfigProperty(propertyName = "DestinationJndiName", propertyValue = "..."),
@ActivationConfigProperty(propertyName = "DestinationType", propertyValue = "javax.jms.Queue")
})
public class TestMyQueueMDB implements MessageListener {
@Resource
private MessageDrivenContext mdc;
public void onMessage(Message message) {
try {
System.out.println("onMessage][START]time=" + new Date());
System.out.println("JMSMessageID : " + message.getJMSMessageID());
System.out.println("JMSRedelivered : " + message.getJMSRedelivered());
System.out.println("JMSXDeliveryCount: " + message.getIntProperty("JMSXDeliveryCount"));
//force retry
mdc.setRollbackOnly();
} catch(Exception e) {
//...
} finally {
System.out.println("[onMessage][END]");
System.out.println();
}
}
//...
}
With an queue created with the default values,
dbms_aqadm.create_queue(
queue_name=>'myQueue',
queue_table=>'myQueueTable'
);
it should print something like this:
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : false
JMSXDeliveryCount: 1
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : true
JMSXDeliveryCount: 2
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : true
JMSXDeliveryCount: 3
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : true
JMSXDeliveryCount: 4
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : true
JMSXDeliveryCount: 5
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:18:26 COT 2014
JMSMessageID : ID:205BD8B6042C4348A778FC5D467D2581
JMSRedelivered : true
JMSXDeliveryCount: 6
[onMessage][END]
After doing an update like the following,
BEGIN
DBMS_AQADM.ALTER_QUEUE (
queue_name => 'MYQUEUE',
max_retries => 2,
retry_delay => 10);
END;
/
it should print something like
[onMessage][START]time: Mon Mar 03 13:13:16 COT 2014
JMSMessageID : ID:61819BE03F7942DE92B2FA196EF13888
JMSRedelivered : false
JMSXDeliveryCount: 1
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:13:26 COT 2014
JMSMessageID : ID:61819BE03F7942DE92B2FA196EF13888
JMSRedelivered : true
JMSXDeliveryCount: 2
[onMessage][END]
[onMessage][START]time: Mon Mar 03 13:13:37 COT 2014
JMSMessageID : ID:61819BE03F7942DE92B2FA196EF13888
JMSRedelivered : true
JMSXDeliveryCount: 3
[onMessage][END]
References:
- Working with JMS and the standard issues in JMS
- Oracle® Database PL/SQL Packages and Types Reference 11g Release 1 (11.1), 22. DBMS_AQADM
No hay comentarios:
Publicar un comentario