Log4j 2
  1. Log4j 2
  2. LOG4J2-367

JMS appenders send two messages for one append

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4, 2.0-beta5, 2.0-beta6, 2.0-beta7, 2.0-beta8
    • Fix Version/s: 2.0-beta9
    • Component/s: Appenders
    • Labels:

      Description

      When using the JMSTopicAppender or JMSQueueAppender calls to append result in JMSTopicManager calling send twice.

      I can see that the code was refactored to support cleanup after exceptions, however the original call to send was not removed after a try/catch was introduced.

      Index: core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java
      ===================================================================
      --- core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java	(revision 1516828)
      +++ core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java	(revision )
      @@ -104,7 +104,7 @@
               if (info == null) {
                   info = connect(context, factoryBindingName, topicBindingName, userName, password, false);
               }
      -        super.send(object, info.session, info.publisher);
      +
               try {
                   super.send(object, info.session, info.publisher);
               } catch (final Exception ex) {
      

        Activity

        Gary Gregory made changes -
        Description When using the JMSTopicAppender or JMSQueueAppender calls to append result in JMSTopicManager calling send twice.

        I can see that the code was refactored to support cleanup after exceptions, however the original call to send was not removed after a try/catch was introduced.

        Index: core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java
        ===================================================================
        --- core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (revision 1516828)
        +++ core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (revision )
        @@ -104,7 +104,7 @@
                 if (info == null) {
                     info = connect(context, factoryBindingName, topicBindingName, userName, password, false);
                 }
        - super.send(object, info.session, info.publisher);
        +
                 try {
                     super.send(object, info.session, info.publisher);
                 } catch (final Exception ex) {
        When using the JMSTopicAppender or JMSQueueAppender calls to append result in JMSTopicManager calling send twice.

        I can see that the code was refactored to support cleanup after exceptions, however the original call to send was not removed after a try/catch was introduced.
        {noformat}
        Index: core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java
        ===================================================================
        --- core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (revision 1516828)
        +++ core/src/main/java/org/apache/logging/log4j/core/net/JMSTopicManager.java (revision )
        @@ -104,7 +104,7 @@
                 if (info == null) {
                     info = connect(context, factoryBindingName, topicBindingName, userName, password, false);
                 }
        - super.send(object, info.session, info.publisher);
        +
                 try {
                     super.send(object, info.session, info.publisher);
                 } catch (final Exception ex) {
        {noformat}
        Gary Gregory made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-beta9 [ 12324756 ]
        Resolution Fixed [ 1 ]
        David Parry created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            David Parry
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development