https://issues.apache.org/bugzilla/show_bug.cgi?id=49247
Summary: Add option for persistent/non-persistent delivery in
JMSAppender
Product: Log4j
Version: 1.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: enhancement
Priority: P2
Component: Appender
AssignedTo: [email protected]
ReportedBy: [email protected]
Add a boolean property to org.apache.log4j.net.JMSAppender that will specify if
messages should be sent in persistent delivery mode. In high-volume
applications, persistent delivery (currently the default) can cause performance
problems on the JMS server.
Suggested code changes:
...
boolean persistentDelivery = false; // add getters/setters
...
/**
This method called by {...@link AppenderSkeleton#doAppend} method to
do most of the real appending work. */
public void append(LoggingEvent event) {
if(!checkEntryConditions()) {
return;
}
try {
ObjectMessage msg = topicSession.createObjectMessage();
if(locationInfo) {
event.getLocationInformation();
}
msg.setObject(event);
/****** Enhancement - check for persistent delivery ******/
msg.setJMSDeliveryMode(persistentDelivery ?
DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
/****** End of enhancement ******/
topicPublisher.publish(msg);
} catch(JMSException e) {
errorHandler.error("Could not publish message in JMSAppender
["+name+"].", e,
ErrorCode.GENERIC_FAILURE);
} catch(RuntimeException e) {
errorHandler.error("Could not publish message in JMSAppender
["+name+"].", e,
ErrorCode.GENERIC_FAILURE);
}
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]