Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
5.15.8
-
None
-
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(); } } }