Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-7111

ActiveMQ print multiple log on console

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 5.15.8
    • None
    • Broker
    • None

    Description

      Hello    .   

      I write example authentication code for my own application .

      but can not understand why logger wrote dual time logs on console .

      this is my example test code :

      import org.apache.activemq.broker.Broker;
      import org.apache.activemq.broker.BrokerFilter;
      import org.apache.activemq.broker.ConnectionContext;
      import org.apache.activemq.command.ConnectionInfo;
      
      import java.util.logging.Logger;
      
      public class AuthenticationFilter extends BrokerFilter {
          private static final Logger logger = Logger.getLogger(AuthenticationFilter.class.getName());
      
          public AuthenticationFilter(Broker next) {
              super(next);
          }
      
          @Override
          public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
              String username = info.getUserName() ;
              String password = info.getPassword() ;
              if (username.equals("EXAMPLE_USER_NAME") && password.equals("EXAMPLE_PASSWORD")) {
                  logger.info("Authentication Success .");
                  super.addConnection(context, info);
              } else {
                  logger.info("Authentication failed .");
                  throw new SecurityException();
              }
          }
      }
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mah454 Mahdi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: