Methods Summary |
---|
protected void | clearResentCounter(java.lang.String id)Remove the resent counter for the message id
synchronized (resent)
{
resent.remove(id);
}
|
protected boolean | handleDelivery(javax.jms.Message msg)
// Check for JBossMQ specific
boolean handled = super.handleDelivery(msg);
if (handled)
return true;
try
{
if (msg.propertyExists(JMS_JBOSS_REDELIVERY_COUNT))
return false;
String id = msg.getJMSMessageID();
if (id == null)
{
log.error("Message id is null? " + msg);
return false;
}
int count = 0;
try
{
if (msg.propertyExists(PROPERTY_DELIVERY_COUNT))
count = msg.getIntProperty(PROPERTY_DELIVERY_COUNT) - 1;
}
catch (JMSException ignored)
{
count = incrementResentCounter(id);
}
if (count > maxResent)
{
warnDLQ(msg, count, maxResent);
clearResentCounter(id);
return true;
}
}
catch (Throwable t)
{
log.warn("Unexpected error checking whether dlq should be used " + msg, t);
}
return false;
|
protected int | incrementResentCounter(java.lang.String id)Increment the resent counter for the message id
ResentInfo info;
synchronized (resent)
{
info = (ResentInfo) resent.get(id);
if (info == null)
{
info = new ResentInfo();
resent.put(id, info);
}
}
return ++info.count;
|
public void | messageDelivered(javax.jms.Message msg)
try
{
String id = msg.getJMSMessageID();
if (id == null)
{
log.error("Message id is null? " + msg);
return;
}
clearResentCounter(id);
}
catch (Throwable t)
{
log.warn("Unexpected error processing delivery notification " + msg, t);
}
|