logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49247] New: Add option for persistent/non-persistent delivery in JMSAppender
Date Tue, 04 May 2010 17:04:24 GMT
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: log4j-dev@logging.apache.org
        ReportedBy: vandezuma@gmail.com


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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message