ARTEMIS-4020 Standardize the naming of Logger types for consistency
Attempt to standardize all Logger declaration to a singular variable name which makes the code more consistent and make finding usages of loggers in the code a bit easier.
This commit is contained in:
parent
2dc0ea1a0c
commit
b900a1e4bd
|
@ -119,7 +119,7 @@ import static org.junit.Assert.fail;
|
|||
* Test to validate that the CLI doesn't throw improper exceptions when invoked.
|
||||
*/
|
||||
public class ArtemisTest extends CliTestBase {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// some tests will set this, as some security methods will need to know the server the CLI started
|
||||
private ActiveMQServer server;
|
||||
|
@ -170,9 +170,9 @@ public class ArtemisTest extends CliTestBase {
|
|||
int writes = 2;
|
||||
int tries = 5;
|
||||
long totalAvg = SyncCalculation.syncTest(temporaryFolder.getRoot(), 4096, writes, tries, true, true, true, "file.tmp", 1, JournalType.NIO);
|
||||
log.debug("TotalAvg = {}", totalAvg);
|
||||
logger.debug("TotalAvg = {}", totalAvg);
|
||||
long nanoTime = SyncCalculation.toNanos(totalAvg, writes, false);
|
||||
log.debug("nanoTime avg = {}", nanoTime);
|
||||
logger.debug("nanoTime avg = {}", nanoTime);
|
||||
assertEquals(0, LibaioContext.getTotalMaxIO());
|
||||
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
|
||||
byte[] contents = Files.readAllBytes(bootstrapFile.toPath());
|
||||
String cfgText = new String(contents);
|
||||
log.debug("confg: {}", cfgText);
|
||||
logger.debug("confg: {}", cfgText);
|
||||
|
||||
config = parseXml(bootstrapFile);
|
||||
webElem = (Element) config.getElementsByTagName("web").item(0);
|
||||
|
@ -449,7 +449,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
listCmd.execute(context);
|
||||
|
||||
String result = context.getStdout();
|
||||
log.debug("output1:\n{}", result);
|
||||
logger.debug("output1:\n{}", result);
|
||||
|
||||
//default only one user admin with role amq
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
|
@ -468,7 +468,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output2:\n{}", result);
|
||||
logger.debug("output2:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertTrue(result.contains("\"guest\"(admin)"));
|
||||
|
@ -489,7 +489,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output3:\n{}", result);
|
||||
logger.debug("output3:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertTrue(result.contains("\"guest\"(admin)"));
|
||||
|
@ -514,7 +514,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output4:\n{}", result);
|
||||
logger.debug("output4:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertTrue(result.contains("\"guest\"(admin)"));
|
||||
|
@ -531,7 +531,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output5:\n{}", result);
|
||||
logger.debug("output5:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertFalse(result.contains("\"guest\"(admin)"));
|
||||
|
@ -549,7 +549,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output6:\n{}", result);
|
||||
logger.debug("output6:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertFalse(result.contains("\"guest\"(admin)"));
|
||||
|
@ -570,7 +570,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output7:\n{}", result);
|
||||
logger.debug("output7:\n{}", result);
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
assertTrue(result.contains("Total: 1"));
|
||||
|
||||
|
@ -585,7 +585,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output8:\n{}", result);
|
||||
logger.debug("output8:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("Total: 0"));
|
||||
} finally {
|
||||
|
@ -879,7 +879,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
listCmd.execute(context);
|
||||
|
||||
String result = context.getStdout();
|
||||
log.debug("output1:\n{}", result);
|
||||
logger.debug("output1:\n{}", result);
|
||||
|
||||
//default only one user admin with role amq
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
|
@ -895,7 +895,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output8:\n{}", result);
|
||||
logger.debug("output8:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("Total: 0"));
|
||||
|
||||
|
@ -928,7 +928,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
context = new TestActionContext();
|
||||
listCmd.execute(context);
|
||||
result = context.getStdout();
|
||||
log.debug("output2:\n{}", result);
|
||||
logger.debug("output2:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("Total: 4"));
|
||||
assertTrue(result.contains("\"guest\"(admin)"));
|
||||
|
@ -1009,7 +1009,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
listCmd.execute(context);
|
||||
|
||||
String result = context.getStdout();
|
||||
log.debug("output1:\n{}", result);
|
||||
logger.debug("output1:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("Total: 1"));
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
|
@ -1039,7 +1039,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
listCmd.execute(context);
|
||||
|
||||
result = context.getStdout();
|
||||
log.debug("output2:\n{}", result);
|
||||
logger.debug("output2:\n{}", result);
|
||||
|
||||
// make sure the admin user is still in tact (i.e. that the file wasn't corrupted via concurrent access)
|
||||
assertTrue(result.contains("\"admin\"(amq)"));
|
||||
|
@ -1112,7 +1112,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
listCmd.execute(context);
|
||||
|
||||
String result = context.getStdout();
|
||||
log.debug("output1:\n{}", result);
|
||||
logger.debug("output1:\n{}", result);
|
||||
|
||||
assertTrue(result.contains("\"admin\"(" + roleWithSpaces + ")"));
|
||||
|
||||
|
@ -1215,7 +1215,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
mask.setPassword(password1);
|
||||
|
||||
String result = (String) mask.execute(context);
|
||||
log.debug(context.getStdout());
|
||||
logger.debug(context.getStdout());
|
||||
assertEquals(encrypt1, result);
|
||||
|
||||
context = new TestActionContext();
|
||||
|
@ -1223,7 +1223,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
mask.setPassword(password1);
|
||||
mask.setHash(true);
|
||||
result = (String) mask.execute(context);
|
||||
log.debug(context.getStdout());
|
||||
logger.debug(context.getStdout());
|
||||
SensitiveDataCodec<String> codec = mask.getCodec();
|
||||
Assert.assertEquals(DefaultSensitiveStringCodec.class, codec.getClass());
|
||||
Assert.assertTrue(((DefaultSensitiveStringCodec)codec).verify(password1.toCharArray(), result));
|
||||
|
@ -1233,7 +1233,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
mask.setPassword(password1);
|
||||
mask.setKey(newKey);
|
||||
result = (String) mask.execute(context);
|
||||
log.debug(context.getStdout());
|
||||
logger.debug(context.getStdout());
|
||||
assertEquals(encrypt2, result);
|
||||
}
|
||||
|
||||
|
@ -2096,7 +2096,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
TestActionContext context = new TestActionContext();
|
||||
PrintVersion printVersion = new PrintVersion();
|
||||
Version result = (Version) printVersion.execute(context);
|
||||
log.debug(context.getStdout());
|
||||
logger.debug(context.getStdout());
|
||||
}
|
||||
|
||||
//read individual lines from byteStream
|
||||
|
@ -2167,7 +2167,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
for (String r : roles) {
|
||||
String storedUsers = (String) roleConfig.getProperty(r);
|
||||
|
||||
log.debug("users in role: {} ; {}", r, storedUsers);
|
||||
logger.debug("users in role: {} ; {}", r, storedUsers);
|
||||
List<String> userList = StringUtil.splitStringList(storedUsers, ",");
|
||||
assertTrue(userList.contains(user));
|
||||
}
|
||||
|
|
|
@ -27,14 +27,14 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class HashUtilTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testDefaultHashFormat() throws Exception {
|
||||
final String password = "helloworld";
|
||||
String hash = HashUtil.tryHash(new TestActionContext(), password);
|
||||
String hashStr = PasswordMaskingUtil.unwrap(hash);
|
||||
log.debug("hashString: {}", hashStr);
|
||||
logger.debug("hashString: {}", hashStr);
|
||||
String[] parts = hashStr.split(":");
|
||||
assertEquals(3, parts.length);
|
||||
//first part should be able to convert to an int
|
||||
|
|
|
@ -41,7 +41,7 @@ import static org.junit.Assert.fail;
|
|||
|
||||
public class ByteUtilTest {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testBytesToString() {
|
||||
|
@ -56,13 +56,13 @@ public class ByteUtilTest {
|
|||
public void testNonASCII() {
|
||||
assertEquals("aA", ByteUtil.toSimpleString(new byte[]{97, 0, 65, 0}));
|
||||
assertEquals(ByteUtil.NON_ASCII_STRING, ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65}));
|
||||
log.debug(ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65}));
|
||||
logger.debug(ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMaxString() {
|
||||
byte[] byteArray = new byte[20 * 1024];
|
||||
log.debug(ByteUtil.maxString(ByteUtil.bytesToHex(byteArray, 2), 150));
|
||||
logger.debug(ByteUtil.maxString(ByteUtil.bytesToHex(byteArray, 2), 150));
|
||||
}
|
||||
|
||||
void testEquals(String string1, String string2) {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.fail;
|
|||
|
||||
public class DefaultSensitiveStringCodecTest {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testDefaultAlgorithm() throws Exception {
|
||||
|
@ -55,7 +55,7 @@ public class DefaultSensitiveStringCodecTest {
|
|||
|
||||
String plainText = "some_password";
|
||||
String maskedText = codec.encode(plainText);
|
||||
log.debug("encoded value: {}", maskedText);
|
||||
logger.debug("encoded value: {}", maskedText);
|
||||
|
||||
if (algorithm.equals(DefaultSensitiveStringCodec.ONE_WAY)) {
|
||||
//one way can't decode
|
||||
|
@ -66,7 +66,7 @@ public class DefaultSensitiveStringCodecTest {
|
|||
}
|
||||
} else {
|
||||
String decoded = codec.decode(maskedText);
|
||||
log.debug("encoded value: {}", maskedText);
|
||||
logger.debug("encoded value: {}", maskedText);
|
||||
|
||||
assertEquals("decoded result not match: " + decoded, decoded, plainText);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class DefaultSensitiveStringCodecTest {
|
|||
|
||||
String plainText = "some_password";
|
||||
String maskedText = codec.encode(plainText);
|
||||
log.debug("encoded value: {}", maskedText);
|
||||
logger.debug("encoded value: {}", maskedText);
|
||||
|
||||
assertTrue(codec.verify(plainText.toCharArray(), maskedText));
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.junit.Assert;
|
|||
import org.junit.Test;
|
||||
|
||||
public class OrderedExecutorSanityTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void shouldExecuteTasksInOrder() throws InterruptedException {
|
||||
|
@ -179,7 +179,7 @@ public class OrderedExecutorSanityTest {
|
|||
|
||||
long elapsed = (end - start);
|
||||
|
||||
log.info("execution {} in {} milliseconds", i, TimeUnit.NANOSECONDS.toMillis(elapsed));
|
||||
logger.info("execution {} in {} milliseconds", i, TimeUnit.NANOSECONDS.toMillis(elapsed));
|
||||
}
|
||||
} finally {
|
||||
executorService.shutdown();
|
||||
|
@ -202,7 +202,7 @@ public class OrderedExecutorSanityTest {
|
|||
CountDownLatch latchBlock3 = new CountDownLatch(1);
|
||||
executor.execute(() -> {
|
||||
try {
|
||||
log.info("Exec 1");
|
||||
logger.info("Exec 1");
|
||||
latchDone1.countDown();
|
||||
latchBlock1.await(10, TimeUnit.SECONDS);
|
||||
} catch (Exception e) {
|
||||
|
@ -216,7 +216,7 @@ public class OrderedExecutorSanityTest {
|
|||
executor.execute(() -> {
|
||||
try {
|
||||
// Exec 2 is supposed to yield to Exec3, so Exec3 will happen first
|
||||
log.info("Exec 2");
|
||||
logger.info("Exec 2");
|
||||
latchDone2.countDown();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -226,7 +226,7 @@ public class OrderedExecutorSanityTest {
|
|||
|
||||
executor2.execute(() -> {
|
||||
try {
|
||||
log.info("Exec 3");
|
||||
logger.info("Exec 3");
|
||||
latchDone3.countDown();
|
||||
latchBlock3.await(10, TimeUnit.SECONDS);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.servlet.ServletContextListener;
|
|||
**/
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class PluginContextListener implements ServletContextListener {
|
|||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Initialized {} plugin", plugin.getName());
|
||||
logger.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class PluginContextListener implements ServletContextListener {
|
|||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Destroyed {} plugin", plugin.getName());
|
||||
logger.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.servlet.ServletContextListener;
|
|||
**/
|
||||
public class PluginContextListener implements ServletContextListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
HawtioPlugin plugin = null;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class PluginContextListener implements ServletContextListener {
|
|||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Initialized {} plugin", plugin.getName());
|
||||
logger.info("Initialized {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class PluginContextListener implements ServletContextListener {
|
|||
throw createServletException(e);
|
||||
}
|
||||
|
||||
LOG.info("Destroyed {} plugin", plugin.getName());
|
||||
logger.info("Destroyed {} plugin", plugin.getName());
|
||||
}
|
||||
|
||||
protected RuntimeException createServletException(Exception e) {
|
||||
|
|
|
@ -57,7 +57,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class ConnectionFactoryURITest {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
ConnectionFactoryParser parser = new ConnectionFactoryParser();
|
||||
|
||||
|
@ -409,7 +409,7 @@ public class ConnectionFactoryURITest {
|
|||
if (ignoreList.contains(descriptor.getName())) {
|
||||
continue;
|
||||
}
|
||||
log.info("name::{}", descriptor.getName());
|
||||
logger.info("name::{}", descriptor.getName());
|
||||
if (descriptor.getWriteMethod() != null && descriptor.getReadMethod() != null) {
|
||||
if (descriptor.getPropertyType() == String.class) {
|
||||
String value = RandomUtil.randomString();
|
||||
|
|
|
@ -54,7 +54,6 @@ import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
|
|||
import org.junit.rules.ExternalResource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/**
|
||||
* Deprecated in favor of EmbeddedActiveMQResource. Since Artemis 2.0 all JMS specific broker management classes,
|
||||
|
@ -79,7 +78,6 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
@Deprecated
|
||||
public class EmbeddedJMSResource extends ExternalResource {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static final String SERVER_NAME = "embedded-jms-server";
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
*/
|
||||
public class ProtonClientConnectionManager implements BaseConnectionLifeCycleListener<ProtonProtocolManager>, BufferHandler {
|
||||
private final Map<Object, ActiveMQProtonRemotingConnection> connectionMap = new ConcurrentHashMap<>();
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private final AMQPClientConnectionFactory connectionFactory;
|
||||
private final Optional<EventHandler> eventHandler;
|
||||
private final ClientSASLFactory clientSASLFactory;
|
||||
|
@ -58,17 +58,17 @@ public class ProtonClientConnectionManager implements BaseConnectionLifeCycleLis
|
|||
connectionMap.put(connection.getID(), amqpConnection);
|
||||
amqpConnection.open();
|
||||
|
||||
log.info("Connection {} created", amqpConnection.getRemoteAddress());
|
||||
logger.info("Connection {} created", amqpConnection.getRemoteAddress());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionDestroyed(Object connectionID) {
|
||||
RemotingConnection connection = connectionMap.remove(connectionID);
|
||||
if (connection != null) {
|
||||
log.info("Connection {} destroyed", connection.getRemoteAddress());
|
||||
logger.info("Connection {} destroyed", connection.getRemoteAddress());
|
||||
connection.fail(new ActiveMQRemoteDisconnectException());
|
||||
} else {
|
||||
log.error("Connection with id {} not found in connectionDestroyed", connectionID);
|
||||
logger.error("Connection with id {} not found in connectionDestroyed", connectionID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,10 +76,10 @@ public class ProtonClientConnectionManager implements BaseConnectionLifeCycleLis
|
|||
public void connectionException(Object connectionID, ActiveMQException me) {
|
||||
RemotingConnection connection = connectionMap.get(connectionID);
|
||||
if (connection != null) {
|
||||
log.info("Connection {} exception: {}", connection.getRemoteAddress(), me.getMessage());
|
||||
logger.info("Connection {} exception: {}", connection.getRemoteAddress(), me.getMessage());
|
||||
connection.fail(me);
|
||||
} else {
|
||||
log.error("Connection with id {} not found in connectionException", connectionID);
|
||||
logger.error("Connection with id {} not found in connectionException", connectionID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,10 +87,10 @@ public class ProtonClientConnectionManager implements BaseConnectionLifeCycleLis
|
|||
public void connectionReadyForWrites(Object connectionID, boolean ready) {
|
||||
RemotingConnection connection = connectionMap.get(connectionID);
|
||||
if (connection != null) {
|
||||
log.info("Connection {} ready", connection.getRemoteAddress());
|
||||
logger.info("Connection {} ready", connection.getRemoteAddress());
|
||||
connection.getTransportConnection().fireReady(true);
|
||||
} else {
|
||||
log.error("Connection with id {} not found in connectionReadyForWrites()!", connectionID);
|
||||
logger.error("Connection with id {} not found in connectionReadyForWrites()!", connectionID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class ProtonClientConnectionManager implements BaseConnectionLifeCycleLis
|
|||
if (connection != null) {
|
||||
connection.bufferReceived(connectionID, buffer);
|
||||
} else {
|
||||
log.error("Connection with id {} not found in bufferReceived()!", connectionID);
|
||||
logger.error("Connection with id {} not found in bufferReceived()!", connectionID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ import static org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport.SCHEM
|
|||
|
||||
public class AMQPConnectionContext extends ProtonInitializable implements EventHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed");
|
||||
public static final String AMQP_CONTAINER_ID = "amqp-container-id";
|
||||
|
@ -235,8 +235,8 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
}
|
||||
|
||||
public void inputBuffer(ByteBuf buffer) {
|
||||
if (log.isTraceEnabled()) {
|
||||
ByteUtil.debugFrame(log, "Buffer Received ", buffer);
|
||||
if (logger.isTraceEnabled()) {
|
||||
ByteUtil.debugFrame(logger, "Buffer Received ", buffer);
|
||||
}
|
||||
|
||||
handler.inputBuffer(buffer);
|
||||
|
@ -376,7 +376,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.missingDesiredCapability(AMQPMirrorControllerSource.MIRROR_CAPABILITY.toString());
|
||||
}
|
||||
} catch (ActiveMQAMQPException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
|
||||
link.setTarget(null);
|
||||
link.setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
|
||||
|
@ -547,7 +547,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
try {
|
||||
initInternal();
|
||||
} catch (Exception e) {
|
||||
log.error("Error init connection", e);
|
||||
logger.error("Error init connection", e);
|
||||
}
|
||||
|
||||
if (!validateUser(connection) || (connectionCallback.getTransportConnection().getRouter() != null
|
||||
|
@ -594,7 +594,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
try {
|
||||
validatedUser = protocolManager.getServer().validateUser(user, password, connectionCallback.getProtonConnectionDelegate(), protocolManager.getSecurityDomain());
|
||||
} catch (ActiveMQSecurityException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
ErrorCondition error = new ErrorCondition();
|
||||
error.setCondition(AmqpError.UNAUTHORIZED_ACCESS);
|
||||
error.setDescription(e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage());
|
||||
|
@ -732,7 +732,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
try {
|
||||
linkContext.close(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -776,7 +776,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
if (handler != null) {
|
||||
handler.onMessage(delivery);
|
||||
} else {
|
||||
log.warn("Handler is null, can't delivery {}", delivery, new Exception("tracing location"));
|
||||
logger.warn("Handler is null, can't delivery {}", delivery, new Exception("tracing location"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class AMQPSessionContext extends ProtonInitializable {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected final AMQPConnectionContext connection;
|
||||
|
||||
protected final AMQPSessionCallback sessionSPI;
|
||||
|
@ -132,7 +132,7 @@ public class AMQPSessionContext extends ProtonInitializable {
|
|||
try {
|
||||
protonProducer.close(false);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
receivers.clear();
|
||||
|
@ -144,7 +144,7 @@ public class AMQPSessionContext extends ProtonInitializable {
|
|||
try {
|
||||
protonConsumer.close(false);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
senders.clear();
|
||||
|
@ -154,7 +154,7 @@ public class AMQPSessionContext extends ProtonInitializable {
|
|||
sessionSPI.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
closed = true;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected SimpleString address;
|
||||
protected SimpleString lastAddress;
|
||||
|
@ -124,7 +124,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
} catch (ActiveMQAMQPNotFoundException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage(), e);
|
||||
logger.debug(e.getMessage(), e);
|
||||
throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
sessionSPI.serverSend(this, tx, receiver, delivery, address, routingContext, message);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
|
||||
deliveryFailed(delivery, receiver, e);
|
||||
|
||||
|
@ -205,7 +205,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
ActiveMQAMQPProtocolLogger.LOGGER.incompatibleAddressFullMessagePolicy(lastAddress.toString(), String.valueOf(lastAddressPolicy), newAddress.toString(), String.valueOf(currentPolicy));
|
||||
}
|
||||
|
||||
log.debug("AddressFullPolicy clash between {}/{} and {}/{}", lastAddress, lastAddressPolicy, newAddress, lastAddressPolicy);
|
||||
logger.debug("AddressFullPolicy clash between {}/{} and {}/{}", lastAddress, lastAddressPolicy, newAddress, lastAddressPolicy);
|
||||
}
|
||||
this.lastAddress = message.getAddressSimpleString();
|
||||
this.lastAddressPolicy = currentPolicy;
|
||||
|
|
|
@ -101,7 +101,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ProtonServerSenderContext extends ProtonInitializable implements ProtonDeliveryHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final Symbol COPY = Symbol.valueOf("copy");
|
||||
private static final Symbol TOPIC = Symbol.valueOf("topic");
|
||||
|
@ -298,7 +298,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
try {
|
||||
sessionSPI.closeSender(brokerConsumer);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
sender.close();
|
||||
connection.flush();
|
||||
|
@ -320,7 +320,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
try {
|
||||
internalClose(remoteLinkClose);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
throw new ActiveMQAMQPInternalErrorException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
try {
|
||||
sessionSPI.ack(null, brokerConsumer, message);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.toString(), e);
|
||||
logger.warn(e.toString(), e);
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorAcknowledgingMessage(message.toString(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
boolean handled = true;
|
||||
|
||||
if (remoteState == null) {
|
||||
log.debug("Received null disposition for delivery update: {}", remoteState);
|
||||
logger.debug("Received null disposition for delivery update: {}", remoteState);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
}
|
||||
break;
|
||||
default:
|
||||
log.debug("Received null or unknown disposition for delivery update: {}", remoteState);
|
||||
logger.debug("Received null or unknown disposition for delivery update: {}", remoteState);
|
||||
handled = false;
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
|
||||
try {
|
||||
if (sender.getLocalState() == EndpointState.CLOSED) {
|
||||
log.debug("Not delivering message {} as the sender is closed and credits were available, if you see too many of these it means clients are issuing credits and closing the connection with pending credits a lot of times", messageReference);
|
||||
logger.debug("Not delivering message {} as the sender is closed and credits were available, if you see too many of these it means clients are issuing credits and closing the connection with pending credits a lot of times", messageReference);
|
||||
return;
|
||||
}
|
||||
AMQPMessage message = CoreAmqpConverter.checkAMQP(messageReference.getMessage(), sessionSPI.getStorageManager());
|
||||
|
@ -560,7 +560,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
}
|
||||
return;
|
||||
}
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
brokerConsumer.errorProcessing(e, messageReference);
|
||||
}
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
try {
|
||||
sessionSPI.ack(null, brokerConsumer, reference.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage(), e);
|
||||
logger.debug(e.getMessage(), e);
|
||||
}
|
||||
delivery.settle();
|
||||
} else {
|
||||
|
@ -650,7 +650,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
|
||||
finishLargeMessage();
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
brokerConsumer.errorProcessing(e, reference);
|
||||
}
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
replaceInitialHeader(deliveryAnnotationsToEncode, context, new NettyWritable(frameBuffer));
|
||||
} catch (IndexOutOfBoundsException indexOutOfBoundsException) {
|
||||
assert position == 0 : "this shouldn't happen unless replaceInitialHeader is updating position before modifying frameBuffer";
|
||||
log.debug("Delivery of message failed with an overFlowException, retrying again with expandable buffer");
|
||||
logger.debug("Delivery of message failed with an overFlowException, retrying again with expandable buffer");
|
||||
|
||||
// on the very first packet, if the initial header was replaced with a much bigger header (re-encoding)
|
||||
// we could recover the situation with a retry using an expandable buffer.
|
||||
|
@ -847,7 +847,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
|
|||
try {
|
||||
sessionSPI.ack(null, brokerConsumer, messageReference.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage(), e);
|
||||
logger.debug(e.getMessage(), e);
|
||||
}
|
||||
delivery.settle();
|
||||
} else {
|
||||
|
|
|
@ -56,7 +56,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final byte SASL = 0x03;
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
((TransportInternal) transport).setUseReadOnlyOutputBuffer(false);
|
||||
} catch (NoSuchMethodError nsme) {
|
||||
// using a version at runtime where the optimization isn't available, ignore
|
||||
log.trace("Proton output buffer optimisation unavailable");
|
||||
logger.trace("Proton output buffer optimisation unavailable");
|
||||
}
|
||||
|
||||
transport.bind(connection);
|
||||
|
@ -176,7 +176,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
return rescheduleAt;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
transport.close();
|
||||
connection.setCondition(new ErrorCondition());
|
||||
} finally {
|
||||
|
@ -318,9 +318,9 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
flush();
|
||||
} else {
|
||||
if (capacity == 0) {
|
||||
log.debug("abandoning: readableBytes={}", buffer.readableBytes());
|
||||
logger.debug("abandoning: readableBytes={}", buffer.readableBytes());
|
||||
} else {
|
||||
log.debug("transport closed, discarding: readableBytes={}, capacity={}", buffer.readableBytes(), transport.capacity());
|
||||
logger.debug("transport closed, discarding: readableBytes={}, capacity={}", buffer.readableBytes(), transport.capacity());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
// server side SASL Listener
|
||||
@Override
|
||||
public void onSaslInit(Sasl sasl, Transport transport) {
|
||||
log.debug("onSaslInit: {}", sasl);
|
||||
logger.debug("onSaslInit: {}", sasl);
|
||||
dispatchRemoteMechanismChosen(sasl.getRemoteMechanisms()[0]);
|
||||
|
||||
if (chosenMechanism != null) {
|
||||
|
@ -410,8 +410,8 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
byte[] dataSASL = new byte[sasl.pending()];
|
||||
|
||||
int received = sasl.recv(dataSASL, 0, dataSASL.length);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Working on sasl, length:{}", received);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Working on sasl, length:{}", received);
|
||||
}
|
||||
|
||||
byte[] response = chosenMechanism.processSASL(received != -1 ? dataSASL : null);
|
||||
|
@ -431,7 +431,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
|
||||
@Override
|
||||
public void onSaslResponse(Sasl sasl, Transport transport) {
|
||||
log.debug("onSaslResponse: {}", sasl);
|
||||
logger.debug("onSaslResponse: {}", sasl);
|
||||
processPending(sasl);
|
||||
}
|
||||
|
||||
|
@ -442,7 +442,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
dispatchMechanismsOffered(sasl.getRemoteMechanisms());
|
||||
|
||||
if (clientSASLMechanism == null) {
|
||||
log.info("Outbound connection failed - unknown mechanism, offered mechanisms: {}",
|
||||
logger.info("Outbound connection failed - unknown mechanism, offered mechanisms: {}",
|
||||
Arrays.asList(sasl.getRemoteMechanisms()));
|
||||
dispatchAuthFailed();
|
||||
} else {
|
||||
|
@ -465,14 +465,14 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
|
||||
@Override
|
||||
public void onSaslOutcome(Sasl sasl, Transport transport) {
|
||||
log.debug("onSaslOutcome: {}", sasl);
|
||||
logger.debug("onSaslOutcome: {}", sasl);
|
||||
switch (sasl.getState()) {
|
||||
case PN_SASL_FAIL:
|
||||
log.info("Outbound connection failed, authentication failure");
|
||||
logger.info("Outbound connection failed, authentication failure");
|
||||
dispatchAuthFailed();
|
||||
break;
|
||||
case PN_SASL_PASS:
|
||||
log.debug("Outbound connection succeeded");
|
||||
logger.debug("Outbound connection succeeded");
|
||||
|
||||
if (sasl.pending() != 0) {
|
||||
byte[] additionalData = new byte[sasl.pending()];
|
||||
|
@ -506,7 +506,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
}
|
||||
|
||||
private void saslComplete(Sasl sasl, Sasl.SaslOutcome saslOutcome) {
|
||||
log.debug("saslComplete: {}", sasl);
|
||||
logger.debug("saslComplete: {}", sasl);
|
||||
sasl.done(saslOutcome);
|
||||
if (chosenMechanism != null) {
|
||||
chosenMechanism.done();
|
||||
|
@ -559,19 +559,19 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
}
|
||||
while ((ev = collector.peek()) != null) {
|
||||
for (EventHandler h : handlers) {
|
||||
log.trace("Handling {} towards {}", ev, h);
|
||||
logger.trace("Handling {} towards {}", ev, h);
|
||||
|
||||
try {
|
||||
Events.dispatch(ev, h);
|
||||
} catch (ActiveMQSecurityException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
ErrorCondition error = new ErrorCondition();
|
||||
error.setCondition(AmqpError.UNAUTHORIZED_ACCESS);
|
||||
error.setDescription(e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage());
|
||||
connection.setCondition(error);
|
||||
connection.close();
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
ErrorCondition error = new ErrorCondition();
|
||||
error.setCondition(AmqpError.INTERNAL_ERROR);
|
||||
error.setDescription("Unrecoverable error: " + (e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage()));
|
||||
|
@ -602,7 +602,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
}
|
||||
|
||||
private void internalHandlerError(Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
ErrorCondition error = new ErrorCondition();
|
||||
error.setCondition(AmqpError.INTERNAL_ERROR);
|
||||
error.setDescription("Unrecoverable error: " + (e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage()));
|
||||
|
@ -645,7 +645,7 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener {
|
|||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
|
||||
receivedFirstPacket = true;
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ProtonTransactionHandler implements ProtonDeliveryHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final int amqpCredit;
|
||||
private final int amqpLowMark;
|
||||
|
@ -174,7 +174,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler {
|
|||
}
|
||||
|
||||
private void txError(Delivery delivery, Throwable e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
connection.runNow(() -> {
|
||||
delivery.settle();
|
||||
if (e instanceof ActiveMQAMQPException) {
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.HashMap;
|
|||
* delegate the the jdk GSSAPI support
|
||||
*/
|
||||
public class GSSAPIServerSASL implements ServerSASL {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String NAME = "GSSAPI";
|
||||
private String loginConfigScope;
|
||||
|
@ -83,7 +83,7 @@ public class GSSAPIServerSASL implements ServerSASL {
|
|||
return challenge;
|
||||
|
||||
} catch (Exception outOfHere) {
|
||||
log.info("Error on sasl input: {}", outOfHere.toString(), outOfHere);
|
||||
logger.info("Error on sasl input: {}", outOfHere.toString(), outOfHere);
|
||||
result = new PrincipalSASLResult(false, null);
|
||||
}
|
||||
return null;
|
||||
|
@ -100,7 +100,7 @@ public class GSSAPIServerSASL implements ServerSASL {
|
|||
try {
|
||||
saslServer.dispose();
|
||||
} catch (SaslException error) {
|
||||
log.debug("Exception on sasl dispose", error);
|
||||
logger.debug("Exception on sasl dispose", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class SelectorParserTest {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public void info(String msg) {
|
||||
log.debug(msg);
|
||||
logger.debug(msg);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -49,7 +49,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ReplicatedJournal implements Journal {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final ReplicationManager replicationManager;
|
||||
|
||||
|
@ -103,8 +103,8 @@ public class ReplicatedJournal implements Journal {
|
|||
Persister persister,
|
||||
final Object record,
|
||||
final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.ADD, id, recordType, persister, record);
|
||||
localJournal.appendAddRecord(id, recordType, persister, record, sync);
|
||||
|
@ -125,8 +125,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final Object record,
|
||||
final boolean sync,
|
||||
final IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.ADD, id, recordType, persister, record);
|
||||
localJournal.appendAddRecord(id, recordType, persister, record, sync, completionCallback);
|
||||
|
@ -139,8 +139,8 @@ public class ReplicatedJournal implements Journal {
|
|||
Object record,
|
||||
boolean sync,
|
||||
IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Append record id = {} recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.EVENT, id, recordType, persister, record);
|
||||
localJournal.appendAddEvent(id, recordType, persister, record, sync, completionCallback);
|
||||
|
@ -176,8 +176,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final byte recordType,
|
||||
final Persister persister,
|
||||
final Object record) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Append record txID={} recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Append record txID={} recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendAddRecordTransactional(journalID, ADD_OPERATION_TYPE.ADD, txID, id, recordType, persister, record);
|
||||
localJournal.appendAddRecordTransactional(txID, id, recordType, persister, record);
|
||||
|
@ -191,8 +191,8 @@ public class ReplicatedJournal implements Journal {
|
|||
*/
|
||||
@Override
|
||||
public void appendCommitRecord(final long txID, final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendCommit txID={}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendCommit txID={}", txID);
|
||||
}
|
||||
replicationManager.appendCommitRecord(journalID, txID, sync, true);
|
||||
localJournal.appendCommitRecord(txID, sync);
|
||||
|
@ -200,8 +200,8 @@ public class ReplicatedJournal implements Journal {
|
|||
|
||||
@Override
|
||||
public void appendCommitRecord(final long txID, final boolean sync, final IOCompletion callback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendCommit {}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendCommit {}", txID);
|
||||
}
|
||||
replicationManager.appendCommitRecord(journalID, txID, sync, true);
|
||||
localJournal.appendCommitRecord(txID, sync, callback);
|
||||
|
@ -212,8 +212,8 @@ public class ReplicatedJournal implements Journal {
|
|||
boolean sync,
|
||||
IOCompletion callback,
|
||||
boolean lineUpContext) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendCommit {}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendCommit {}", txID);
|
||||
}
|
||||
replicationManager.appendCommitRecord(journalID, txID, sync, lineUpContext);
|
||||
localJournal.appendCommitRecord(txID, sync, callback, lineUpContext);
|
||||
|
@ -227,8 +227,8 @@ public class ReplicatedJournal implements Journal {
|
|||
*/
|
||||
@Override
|
||||
public void appendDeleteRecord(final long id, final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete {}", id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete {}", id);
|
||||
}
|
||||
replicationManager.appendDeleteRecord(journalID, id);
|
||||
localJournal.appendDeleteRecord(id, sync);
|
||||
|
@ -242,8 +242,8 @@ public class ReplicatedJournal implements Journal {
|
|||
*/
|
||||
@Override
|
||||
public void tryAppendDeleteRecord(final long id, final JournalUpdateCallback updateCallback, final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete {}", id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete {}", id);
|
||||
}
|
||||
replicationManager.appendDeleteRecord(journalID, id);
|
||||
localJournal.tryAppendDeleteRecord(id, updateCallback, sync);
|
||||
|
@ -253,8 +253,8 @@ public class ReplicatedJournal implements Journal {
|
|||
public void appendDeleteRecord(final long id,
|
||||
final boolean sync,
|
||||
final IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete {}", id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete {}", id);
|
||||
}
|
||||
replicationManager.appendDeleteRecord(journalID, id);
|
||||
localJournal.appendDeleteRecord(id, sync, completionCallback);
|
||||
|
@ -265,8 +265,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final boolean sync,
|
||||
final JournalUpdateCallback updateCallback,
|
||||
final IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete {}", id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete {}", id);
|
||||
}
|
||||
replicationManager.appendDeleteRecord(journalID, id);
|
||||
localJournal.tryAppendDeleteRecord(id, sync, updateCallback, completionCallback);
|
||||
|
@ -294,8 +294,8 @@ public class ReplicatedJournal implements Journal {
|
|||
public void appendDeleteRecordTransactional(final long txID,
|
||||
final long id,
|
||||
final EncodingSupport record) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete txID={} id={}", txID, id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete txID={} id={}", txID, id);
|
||||
}
|
||||
replicationManager.appendDeleteRecordTransactional(journalID, txID, id, record);
|
||||
localJournal.appendDeleteRecordTransactional(txID, id, record);
|
||||
|
@ -309,8 +309,8 @@ public class ReplicatedJournal implements Journal {
|
|||
*/
|
||||
@Override
|
||||
public void appendDeleteRecordTransactional(final long txID, final long id) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendDelete (noencoding) txID={} id={}", txID, id);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendDelete (noencoding) txID={} id={}", txID, id);
|
||||
}
|
||||
replicationManager.appendDeleteRecordTransactional(journalID, txID, id);
|
||||
localJournal.appendDeleteRecordTransactional(txID, id);
|
||||
|
@ -339,8 +339,8 @@ public class ReplicatedJournal implements Journal {
|
|||
public void appendPrepareRecord(final long txID,
|
||||
final EncodingSupport transactionData,
|
||||
final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendPrepare txID={}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendPrepare txID={}", txID);
|
||||
}
|
||||
replicationManager.appendPrepareRecord(journalID, txID, transactionData);
|
||||
localJournal.appendPrepareRecord(txID, transactionData, sync);
|
||||
|
@ -351,8 +351,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final EncodingSupport transactionData,
|
||||
final boolean sync,
|
||||
final IOCompletion callback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendPrepare txID={}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendPrepare txID={}", txID);
|
||||
}
|
||||
replicationManager.appendPrepareRecord(journalID, txID, transactionData);
|
||||
localJournal.appendPrepareRecord(txID, transactionData, sync, callback);
|
||||
|
@ -366,8 +366,8 @@ public class ReplicatedJournal implements Journal {
|
|||
*/
|
||||
@Override
|
||||
public void appendRollbackRecord(final long txID, final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendRollback {}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendRollback {}", txID);
|
||||
}
|
||||
replicationManager.appendRollbackRecord(journalID, txID);
|
||||
localJournal.appendRollbackRecord(txID, sync);
|
||||
|
@ -375,8 +375,8 @@ public class ReplicatedJournal implements Journal {
|
|||
|
||||
@Override
|
||||
public void appendRollbackRecord(final long txID, final boolean sync, final IOCompletion callback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendRollback {}", txID);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendRollback {}", txID);
|
||||
}
|
||||
replicationManager.appendRollbackRecord(journalID, txID);
|
||||
localJournal.appendRollbackRecord(txID, sync, callback);
|
||||
|
@ -423,8 +423,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final Persister persister,
|
||||
final Object record,
|
||||
final boolean sync) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendUpdateRecord id = {} , recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendUpdateRecord id = {} , recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.UPDATE, id, recordType, persister, record);
|
||||
localJournal.appendUpdateRecord(id, recordType, persister, record, sync);
|
||||
|
@ -437,8 +437,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final Object record,
|
||||
final JournalUpdateCallback updateCallback,
|
||||
final boolean sync, final boolean replaceable) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendUpdateRecord id = {} , recordType = {}", id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendUpdateRecord id = {} , recordType = {}", id, recordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.UPDATE, id, recordType, persister, record);
|
||||
localJournal.tryAppendUpdateRecord(id, recordType, persister, record, updateCallback, sync, replaceable);
|
||||
|
@ -451,8 +451,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final Object record,
|
||||
final boolean sync,
|
||||
final IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendUpdateRecord id = {} , recordType = {}", id, journalRecordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendUpdateRecord id = {} , recordType = {}", id, journalRecordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.UPDATE, id, journalRecordType, persister, record);
|
||||
localJournal.appendUpdateRecord(id, journalRecordType, persister, record, sync, completionCallback);
|
||||
|
@ -467,8 +467,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final boolean replaceableUpdate,
|
||||
final JournalUpdateCallback updateCallback,
|
||||
final IOCompletion completionCallback) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendUpdateRecord id = {} , recordType = {}", id, journalRecordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendUpdateRecord id = {} , recordType = {}", id, journalRecordType);
|
||||
}
|
||||
replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.UPDATE, id, journalRecordType, persister, record);
|
||||
localJournal.tryAppendUpdateRecord(id, journalRecordType, persister, record, sync, replaceableUpdate, updateCallback, completionCallback);
|
||||
|
@ -504,8 +504,8 @@ public class ReplicatedJournal implements Journal {
|
|||
final byte recordType,
|
||||
final Persister persister,
|
||||
final Object record) throws Exception {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("AppendUpdateRecord txid={} id = {} , recordType = {}", txID, id, recordType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("AppendUpdateRecord txid={} id = {} , recordType = {}", txID, id, recordType);
|
||||
}
|
||||
replicationManager.appendAddRecordTransactional(journalID, ADD_OPERATION_TYPE.UPDATE, txID, id, recordType, persister, record);
|
||||
localJournal.appendUpdateRecordTransactional(txID, id, recordType, persister, record);
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
public abstract class NodeManager implements ActiveMQComponent {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@FunctionalInterface
|
||||
public interface LockListener {
|
||||
|
@ -171,7 +171,7 @@ public abstract class NodeManager implements ActiveMQComponent {
|
|||
try {
|
||||
lockListener.lostLock();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("On notify lost lock", e);
|
||||
logger.warn("On notify lost lock", e);
|
||||
// Need to notify everyone so ignore any exception
|
||||
}
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequ
|
|||
*/
|
||||
public final class ReplicationBackupActivation extends Activation implements DistributedPrimitiveManager.UnavailableManagerListener {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final ReplicationBackupPolicy policy;
|
||||
private final ActiveMQServerImpl activeMQServer;
|
||||
|
@ -112,7 +112,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
return;
|
||||
}
|
||||
}
|
||||
LOGGER.info("Unavailable quorum service detected: try restart server");
|
||||
logger.info("Unavailable quorum service detected: try restart server");
|
||||
asyncRestartServer(activeMQServer, true);
|
||||
}
|
||||
|
||||
|
@ -170,12 +170,12 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
while (true) {
|
||||
distributedManager.start();
|
||||
try {
|
||||
liveLockWithInSyncReplica = tryActivate(activeMQServer.getNodeManager(), distributedManager, LOGGER);
|
||||
liveLockWithInSyncReplica = tryActivate(activeMQServer.getNodeManager(), distributedManager, logger);
|
||||
break;
|
||||
} catch (UnavailableStateException canRecoverEx) {
|
||||
distributedManager.stop();
|
||||
} catch (NodeManager.NodeManagerException fatalEx) {
|
||||
LOGGER.warn("Failed while auto-repairing activation sequence: stop server now", fatalEx);
|
||||
logger.warn("Failed while auto-repairing activation sequence: stop server now", fatalEx);
|
||||
asyncRestartServer(activeMQServer, false);
|
||||
return;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
|
||||
final ClusterController clusterController = activeMQServer.getClusterManager().getClusterController();
|
||||
|
||||
LOGGER.info("Apache ActiveMQ Artemis Backup Server version {} [{}] started, awaiting connection to a live cluster member to start replication", activeMQServer.getVersion().getFullVersion(),
|
||||
logger.info("Apache ActiveMQ Artemis Backup Server version {} [{}] started, awaiting connection to a live cluster member to start replication", activeMQServer.getVersion().getFullVersion(),
|
||||
activeMQServer.toString());
|
||||
|
||||
clusterController.awaitConnectionToReplicationCluster();
|
||||
|
@ -240,9 +240,9 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
// stopBackup is going to write the NodeID and activation sequence previously set on the NodeManager,
|
||||
// because activeMQServer.resetNodeManager() has created a NodeManager with replicatedBackup == true.
|
||||
nodeManager.stopBackup();
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), nodeManager, distributedManager, LOGGER);
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), nodeManager, distributedManager, logger);
|
||||
} catch (Throwable fatal) {
|
||||
LOGGER.warn(fatal.getMessage());
|
||||
logger.warn(fatal.getMessage());
|
||||
// policy is already live one, but there's no activation yet: we can just stop
|
||||
asyncRestartServer(activeMQServer, false, false);
|
||||
throw new ActiveMQIllegalStateException("This server cannot ensure sequential access to broker data: activation is failed");
|
||||
|
@ -263,7 +263,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
try {
|
||||
stillLive = liveLock.isHeldByCaller();
|
||||
} catch (UnavailableStateException e) {
|
||||
LOGGER.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
primaryActivation.onUnavailableLockEvent();
|
||||
throw new ActiveMQIllegalStateException("This server cannot check its role as a live: activation is failed");
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
}
|
||||
}
|
||||
if (expectedNodeID != null) {
|
||||
LOGGER.info("awaiting connecting to any live node with NodeID = {}", expectedNodeID);
|
||||
logger.info("awaiting connecting to any live node with NodeID = {}", expectedNodeID);
|
||||
}
|
||||
final ReplicationFailure failure = replicateLive(clusterController, nodeLocator, registrationFailureForwarder);
|
||||
if (failure == null) {
|
||||
|
@ -314,7 +314,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
if (!activeMQServer.isStarted()) {
|
||||
return null;
|
||||
}
|
||||
LOGGER.debug("ReplicationFailure = {}", failure);
|
||||
logger.debug("ReplicationFailure = {}", failure);
|
||||
switch (failure) {
|
||||
case VoluntaryFailOver:
|
||||
case NonVoluntaryFailover:
|
||||
|
@ -330,14 +330,14 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
DistributedLock liveLockWithInSyncReplica = null;
|
||||
if (nodeManager.getNodeActivationSequence() > 0) {
|
||||
try {
|
||||
liveLockWithInSyncReplica = tryActivate(nodeManager, distributedManager, LOGGER);
|
||||
liveLockWithInSyncReplica = tryActivate(nodeManager, distributedManager, logger);
|
||||
} catch (Throwable error) {
|
||||
// no need to retry here, can just restart as backup that will handle a more resilient tryActivate
|
||||
LOGGER.warn("Errored while attempting failover", error);
|
||||
logger.warn("Errored while attempting failover", error);
|
||||
liveLockWithInSyncReplica = null;
|
||||
}
|
||||
} else {
|
||||
LOGGER.error("Expected positive local activation sequence for NodeID = {} during fail-over, but was {}: restarting as backup",
|
||||
logger.error("Expected positive local activation sequence for NodeID = {} during fail-over, but was {}: restarting as backup",
|
||||
nodeManager.getNodeId(), nodeManager.getNodeActivationSequence());
|
||||
}
|
||||
assert stopping.get();
|
||||
|
@ -349,13 +349,13 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
asyncRestartServer(activeMQServer, true, false);
|
||||
return null;
|
||||
case RegistrationError:
|
||||
LOGGER.error("Stopping broker because of critical registration error");
|
||||
logger.error("Stopping broker because of critical registration error");
|
||||
asyncRestartServer(activeMQServer, false);
|
||||
return null;
|
||||
case AlreadyReplicating:
|
||||
// can just retry here, data should be clean and nodeLocator
|
||||
// should remove the live node that has answered this
|
||||
LOGGER.info("Live broker was already replicating: retry sync with another live");
|
||||
logger.info("Live broker was already replicating: retry sync with another live");
|
||||
continue;
|
||||
case ClosedObserver:
|
||||
return null;
|
||||
|
@ -368,22 +368,22 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
try {
|
||||
activeMQServer.getNodeManager().setNodeActivationSequence(NULL_NODE_ACTIVATION_SEQUENCE);
|
||||
} catch (Throwable fatal) {
|
||||
LOGGER.error("Errored while resetting local activation sequence {} for NodeID = {}: stopping broker",
|
||||
logger.error("Errored while resetting local activation sequence {} for NodeID = {}: stopping broker",
|
||||
activationSequence, syncNodeId, fatal);
|
||||
restart = false;
|
||||
}
|
||||
}
|
||||
if (restart) {
|
||||
LOGGER.info("Replication failure while initial sync not yet completed: restart as backup");
|
||||
logger.info("Replication failure while initial sync not yet completed: restart as backup");
|
||||
}
|
||||
asyncRestartServer(activeMQServer, restart);
|
||||
return null;
|
||||
case WrongNodeId:
|
||||
LOGGER.error("Stopping broker because of wrong node ID communication from live: maybe a misbehaving live?");
|
||||
logger.error("Stopping broker because of wrong node ID communication from live: maybe a misbehaving live?");
|
||||
asyncRestartServer(activeMQServer, false);
|
||||
return null;
|
||||
case WrongActivationSequence:
|
||||
LOGGER.error("Stopping broker because of wrong activation sequence communication from live: maybe a misbehaving live?");
|
||||
logger.error("Stopping broker because of wrong activation sequence communication from live: maybe a misbehaving live?");
|
||||
asyncRestartServer(activeMQServer, false);
|
||||
return null;
|
||||
default:
|
||||
|
@ -446,7 +446,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
try {
|
||||
task.run();
|
||||
} catch (Throwable ignore) {
|
||||
LOGGER.debug(debugErrorMessage, ignore);
|
||||
logger.debug(debugErrorMessage, ignore);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis
|
|||
return clusterController.connectToNodeInReplicatedCluster(tc);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
logger.debug(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequ
|
|||
*/
|
||||
public class ReplicationPrimaryActivation extends LiveActivation implements DistributedLock.UnavailableLockListener {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// This is the time we expect a replica to become a live from the quorum pov
|
||||
// ie time to execute tryActivate and ensureSequentialAccessToNodeData
|
||||
|
@ -125,7 +125,7 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
while (true) {
|
||||
distributedManager.start();
|
||||
try {
|
||||
liveLock = tryActivate(nodeManager, distributedManager, LOGGER);
|
||||
liveLock = tryActivate(nodeManager, distributedManager, logger);
|
||||
break;
|
||||
} catch (UnavailableStateException canRecoverEx) {
|
||||
distributedManager.stop();
|
||||
|
@ -133,12 +133,12 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
}
|
||||
if (liveLock == null) {
|
||||
distributedManager.stop();
|
||||
LOGGER.info("This broker cannot become a live server with NodeID = {}: restarting as backup", nodeManager.getNodeId());
|
||||
logger.info("This broker cannot become a live server with NodeID = {}: restarting as backup", nodeManager.getNodeId());
|
||||
activeMQServer.setHAPolicy(policy.getBackupPolicy());
|
||||
return;
|
||||
}
|
||||
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), nodeManager, distributedManager, LOGGER);
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), nodeManager, distributedManager, logger);
|
||||
|
||||
activeMQServer.initialisePart1(false);
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
throw new IllegalStateException("NodeManager should be started");
|
||||
}
|
||||
final long activationSequence = activeMQServer.getNodeManager().getNodeActivationSequence();
|
||||
LOGGER.info("Applying shared peer NodeID={} to enable coordinated live activation", coordinationId);
|
||||
logger.info("Applying shared peer NodeID={} to enable coordinated live activation", coordinationId);
|
||||
// REVISIT: this is quite clunky, also in backup activation, we just need new nodeID persisted!
|
||||
activeMQServer.resetNodeManager();
|
||||
final NodeManager nodeManager = activeMQServer.getNodeManager();
|
||||
|
@ -207,7 +207,7 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
} catch (ActiveMQAlreadyReplicatingException are) {
|
||||
channel.send(new BackupReplicationStartFailedMessage(BackupReplicationStartFailedMessage.BackupRegistrationProblem.ALREADY_REPLICATING));
|
||||
} catch (ActiveMQException e) {
|
||||
LOGGER.debug("Failed to process backup registration packet", e);
|
||||
logger.debug("Failed to process backup registration packet", e);
|
||||
channel.send(new BackupReplicationStartFailedMessage(BackupReplicationStartFailedMessage.BackupRegistrationProblem.EXCEPTION));
|
||||
}
|
||||
}
|
||||
|
@ -303,14 +303,14 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
}
|
||||
final ReplicationManager replicationManager = this.replicationManager;
|
||||
if (replicationManager == null) {
|
||||
LOGGER.warn("Failback interrupted");
|
||||
logger.warn("Failback interrupted");
|
||||
// we got a disconnection from the replica *before* stopping acceptors: better not failback!
|
||||
return;
|
||||
}
|
||||
// IMPORTANT: this is going to save server::fail to issue a replica connection failure (with failed == false)
|
||||
// because onReplicationConnectionClose fail-fast on stopping == true.
|
||||
if (!stoppingServer.compareAndSet(false, true)) {
|
||||
LOGGER.info("Failback interrupted: server is already stopping");
|
||||
logger.info("Failback interrupted: server is already stopping");
|
||||
return;
|
||||
}
|
||||
coordinatedLockAndNodeId = activeMQServer.getNodeManager().getNodeId().toString();
|
||||
|
@ -321,12 +321,12 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
}
|
||||
try {
|
||||
distributedManager.start();
|
||||
if (!awaitNextCommittedActivationSequence(distributedManager, coordinatedLockAndNodeId, inSyncReplicaActivation, FAILBACK_TIMEOUT_MILLIS, LOGGER)) {
|
||||
LOGGER.warn("Timed out waiting for failback server activation with NodeID = {}: and sequence > {}: after {}ms",
|
||||
if (!awaitNextCommittedActivationSequence(distributedManager, coordinatedLockAndNodeId, inSyncReplicaActivation, FAILBACK_TIMEOUT_MILLIS, logger)) {
|
||||
logger.warn("Timed out waiting for failback server activation with NodeID = {}: and sequence > {}: after {}ms",
|
||||
coordinatedLockAndNodeId, inSyncReplicaActivation, FAILBACK_TIMEOUT_MILLIS);
|
||||
}
|
||||
} catch (UnavailableStateException ignored) {
|
||||
LOGGER.debug("Unavailable distributed manager while awaiting failback activation sequence: ignored", ignored);
|
||||
logger.debug("Unavailable distributed manager while awaiting failback activation sequence: ignored", ignored);
|
||||
} finally {
|
||||
distributedManager.stop();
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
|
||||
@Override
|
||||
public void onUnavailableLockEvent() {
|
||||
LOGGER.error("Quorum UNAVAILABLE: async stopping broker.");
|
||||
logger.error("Quorum UNAVAILABLE: async stopping broker.");
|
||||
asyncStopServer();
|
||||
}
|
||||
|
||||
|
@ -388,9 +388,9 @@ public class ReplicationPrimaryActivation extends LiveActivation implements Dist
|
|||
// we increment only if we are staying alive
|
||||
if (!stoppingServer.get() && STARTED.equals(activeMQServer.getState())) {
|
||||
try {
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), activeMQServer.getNodeManager(), distributedManager, LOGGER);
|
||||
ensureSequentialAccessToNodeData(activeMQServer.toString(), activeMQServer.getNodeManager(), distributedManager, logger);
|
||||
} catch (Throwable fatal) {
|
||||
LOGGER.error("Unexpected exception: {} on attempted activation sequence increment; stopping server async", fatal.getLocalizedMessage(), fatal);
|
||||
logger.error("Unexpected exception: {} on attempted activation sequence increment; stopping server async", fatal.getLocalizedMessage(), fatal);
|
||||
asyncStopServer();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class MetricsManager {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final String brokerName;
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class MetricsManager {
|
|||
for (Gauge.Builder gaugeBuilder : newMeters) {
|
||||
Gauge gauge = gaugeBuilder.register(meterRegistry);
|
||||
meters.add(gauge);
|
||||
log.debug("Registered meter: {}", gauge.getId());
|
||||
logger.debug("Registered meter: {}", gauge.getId());
|
||||
}
|
||||
return meters;
|
||||
});
|
||||
|
@ -157,7 +157,7 @@ public class MetricsManager {
|
|||
}
|
||||
for (Meter meter : meters) {
|
||||
Meter removed = meterRegistry.remove(meter);
|
||||
log.debug("Unregistered meter: {}", removed.getId());
|
||||
logger.debug("Unregistered meter: {}", removed.getId());
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -71,7 +71,7 @@ import org.junit.Test;
|
|||
|
||||
public class ConfigurationImplTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected Configuration conf;
|
||||
|
||||
|
@ -571,7 +571,7 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
|
|||
tempFolder = new File(tempFolder.getAbsolutePath());
|
||||
tempFolder.mkdirs();
|
||||
|
||||
log.debug("TempFolder = {}", tempFolder.getAbsolutePath());
|
||||
logger.debug("TempFolder = {}", tempFolder.getAbsolutePath());
|
||||
|
||||
ConfigurationImpl configuration = new ConfigurationImpl();
|
||||
configuration.setJournalDirectory(tempFolder.getAbsolutePath());
|
||||
|
@ -589,7 +589,7 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
|
|||
tempFolder = new File(tempFolder.getAbsolutePath());
|
||||
tempFolder.mkdirs();
|
||||
|
||||
log.debug("TempFolder = {}", tempFolder.getAbsolutePath());
|
||||
logger.debug("TempFolder = {}", tempFolder.getAbsolutePath());
|
||||
configuration.setNodeManagerLockDirectory(tempFolder.getAbsolutePath());
|
||||
File lockLocation = configuration.getNodeManagerLockLocation();
|
||||
Assert.assertTrue(lockLocation.exists());
|
||||
|
|
|
@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
@RunWith(Parameterized.class)
|
||||
public class JAASSecurityManagerTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Parameterized.Parameters(name = "newLoader=({0})")
|
||||
public static Collection<Object[]> data() {
|
||||
|
@ -78,7 +78,7 @@ public class JAASSecurityManagerTest {
|
|||
@Test
|
||||
public void testLoginClassloading() throws Exception {
|
||||
ClassLoader existingLoader = Thread.currentThread().getContextClassLoader();
|
||||
log.debug("loader: {}", existingLoader);
|
||||
logger.debug("loader: {}", existingLoader);
|
||||
try {
|
||||
if (usingNewLoader) {
|
||||
URLClassLoader simulatedLoader = new URLClassLoader(new URL[]{tmpDir.getRoot().toURI().toURL()}, null);
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.junit.Test;
|
|||
|
||||
public class FileStoreMonitorTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ScheduledExecutorService scheduledExecutorService;
|
||||
private ExecutorService executorService;
|
||||
|
@ -81,19 +81,19 @@ public class FileStoreMonitorTest extends ActiveMQTestBase {
|
|||
@Override
|
||||
public void tick(long usableSpace, long totalSpace) {
|
||||
tick.incrementAndGet();
|
||||
log.debug("tick:: usableSpace: {}, totalSpace:{}", usableSpace, totalSpace);
|
||||
logger.debug("tick:: usableSpace: {}, totalSpace:{}", usableSpace, totalSpace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void over(long usableSpace, long totalSpace) {
|
||||
over.incrementAndGet();
|
||||
log.debug("over:: usableSpace: {}, totalSpace:{}", usableSpace, totalSpace);
|
||||
logger.debug("over:: usableSpace: {}, totalSpace:{}", usableSpace, totalSpace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void under(long usableSpace, long totalSpace) {
|
||||
under.incrementAndGet();
|
||||
log.debug("under:: usableSpace: {}, totalSpace: {}", usableSpace, totalSpace);
|
||||
logger.debug("under:: usableSpace: {}, totalSpace: {}", usableSpace, totalSpace);
|
||||
}
|
||||
};
|
||||
FileStoreMonitor storeMonitor = new FileStoreMonitor(scheduledExecutorService, executorService, 100, TimeUnit.MILLISECONDS, 0.999, null);
|
||||
|
@ -125,7 +125,7 @@ public class FileStoreMonitorTest extends ActiveMQTestBase {
|
|||
storeMonitor.addCallback(new FileStoreMonitor.Callback() {
|
||||
@Override
|
||||
public void tick(long usableSpace, long totalSpace) {
|
||||
log.debug("Tick");
|
||||
logger.debug("Tick");
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ import org.junit.Test;
|
|||
|
||||
public class ScheduledDeliveryHandlerTest extends Assert {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testScheduleRandom() throws Exception {
|
||||
|
@ -285,7 +285,7 @@ public class ScheduledDeliveryHandlerTest extends Assert {
|
|||
assertTrue(ref.getScheduledDeliveryTime() >= lastTime);
|
||||
} else {
|
||||
if (ref.getScheduledDeliveryTime() < lastTime) {
|
||||
log.debug("^^^fail at {}", ref.getScheduledDeliveryTime());
|
||||
logger.debug("^^^fail at {}", ref.getScheduledDeliveryTime());
|
||||
}
|
||||
}
|
||||
lastTime = ref.getScheduledDeliveryTime();
|
||||
|
|
|
@ -74,7 +74,7 @@ import org.junit.Assert;
|
|||
import org.junit.Test;
|
||||
|
||||
public class TransactionImplTest extends ActiveMQTestBase {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testTimeoutAndThenCommitWithARollback() throws Exception {
|
||||
|
@ -102,7 +102,7 @@ public class TransactionImplTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public void afterCommit(Transaction tx) {
|
||||
log.debug("commit...");
|
||||
logger.debug("commit...");
|
||||
commit.incrementAndGet();
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ public class TransactionImplTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public void afterRollback(Transaction tx) {
|
||||
log.debug("rollback...");
|
||||
logger.debug("rollback...");
|
||||
rollback.incrementAndGet();
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class TransactionImplTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public void afterCommit(Transaction tx) {
|
||||
log.debug("commit...");
|
||||
logger.debug("commit...");
|
||||
commit.incrementAndGet();
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class TransactionImplTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public void afterRollback(Transaction tx) {
|
||||
log.debug("rollback...");
|
||||
logger.debug("rollback...");
|
||||
rollback.incrementAndGet();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ import org.junit.Assert;
|
|||
import org.junit.Test;
|
||||
|
||||
public class AcceptorParserTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testAcceptor() throws Exception {
|
||||
List<TransportConfiguration> configs = ConfigurationUtils.parseAcceptorURI("test", "tcp://localhost:8080?tcpSendBufferSize=1048576&tcpReceiveBufferSize=1048576&protocols=openwire&banana=x");
|
||||
|
||||
for (TransportConfiguration config : configs) {
|
||||
log.debug("config: {}", config);
|
||||
logger.debug("config: {}", config);
|
||||
Assert.assertTrue(config.getExtraParams().get("banana").equals("x"));
|
||||
}
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ public class AcceptorParserTest {
|
|||
List<TransportConfiguration> configs = ConfigurationUtils.parseAcceptorURI("test", "tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;virtualTopicConsumerWildcards=Consumer.*.%3E%3B2");
|
||||
|
||||
for (TransportConfiguration config : configs) {
|
||||
log.debug("config: {}", config);
|
||||
log.debug("{}", config.getExtraParams().get("virtualTopicConsumerWildcards"));
|
||||
logger.debug("config: {}", config);
|
||||
logger.debug("{}", config.getExtraParams().get("virtualTopicConsumerWildcards"));
|
||||
Assert.assertTrue(config.getExtraParams().get("virtualTopicConsumerWildcards").equals("Consumer.*.>;2"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,6 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import org.junit.rules.ExternalResource;
|
||||
|
||||
/**
|
||||
|
@ -31,8 +28,6 @@ import org.junit.rules.ExternalResource;
|
|||
*/
|
||||
public class CleanupSystemPropertiesRule extends ExternalResource {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private Properties originalProperties;
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.junit.runner.Description;
|
|||
*/
|
||||
public class ThreadLeakCheckRule extends TestWatcher {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static Set<String> knownThreads = new HashSet<>();
|
||||
|
||||
|
@ -84,8 +84,8 @@ public class ThreadLeakCheckRule extends TestWatcher {
|
|||
*/
|
||||
@Override
|
||||
protected void finished(Description description) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("checking thread enabled? {}, testFailed? {}", enabled, testFailed);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("checking thread enabled? {}, testFailed? {}", enabled, testFailed);
|
||||
}
|
||||
try {
|
||||
if (enabled) {
|
||||
|
@ -139,10 +139,10 @@ public class ThreadLeakCheckRule extends TestWatcher {
|
|||
public static void forceGC() {
|
||||
|
||||
if (failedGCCalls >= 10) {
|
||||
log.info("ignoring forceGC call since it seems System.gc is not working anyways");
|
||||
logger.info("ignoring forceGC call since it seems System.gc is not working anyways");
|
||||
return;
|
||||
}
|
||||
log.info("#test forceGC");
|
||||
logger.info("#test forceGC");
|
||||
CountDownLatch finalized = new CountDownLatch(1);
|
||||
WeakReference<DumbReference> dumbReference = new WeakReference<>(new DumbReference(finalized));
|
||||
|
||||
|
@ -160,12 +160,12 @@ public class ThreadLeakCheckRule extends TestWatcher {
|
|||
|
||||
if (dumbReference.get() != null) {
|
||||
failedGCCalls++;
|
||||
log.info("It seems that GC is disabled at your VM");
|
||||
logger.info("It seems that GC is disabled at your VM");
|
||||
} else {
|
||||
// a success would reset the count
|
||||
failedGCCalls = 0;
|
||||
}
|
||||
log.info("#test forceGC Done ");
|
||||
logger.info("#test forceGC Done ");
|
||||
}
|
||||
|
||||
public static void forceGC(final Reference<?> ref, final long timeout) {
|
||||
|
|
|
@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public abstract class PerfBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "target/classes/perf.properties";
|
||||
|
||||
|
@ -95,20 +95,20 @@ public abstract class PerfBase {
|
|||
String clientLibrary = props.getProperty("client-library", "core");
|
||||
String uri = props.getProperty("server-uri", "tcp://localhost:61616");
|
||||
|
||||
PerfBase.log.info("num-messages: {}", noOfMessages);
|
||||
PerfBase.log.info("num-warmup-messages: {}", noOfWarmupMessages);
|
||||
PerfBase.log.info("message-size: {}", messageSize);
|
||||
PerfBase.log.info("durable: {}", durable);
|
||||
PerfBase.log.info("transacted: {}", transacted);
|
||||
PerfBase.log.info("batch-size: {}", batchSize);
|
||||
PerfBase.log.info("drain-queue: {}", drainQueue);
|
||||
PerfBase.log.info("throttle-rate: {}", throttleRate);
|
||||
PerfBase.log.info("destination-name: {}", destinationName);
|
||||
PerfBase.log.info("disable-message-id: {}", disableMessageID);
|
||||
PerfBase.log.info("disable-message-timestamp: {}", disableTimestamp);
|
||||
PerfBase.log.info("dups-ok-acknowledge: {}", dupsOK);
|
||||
PerfBase.log.info("server-uri: {}", uri);
|
||||
PerfBase.log.info("client-library:{}", clientLibrary);
|
||||
PerfBase.logger.info("num-messages: {}", noOfMessages);
|
||||
PerfBase.logger.info("num-warmup-messages: {}", noOfWarmupMessages);
|
||||
PerfBase.logger.info("message-size: {}", messageSize);
|
||||
PerfBase.logger.info("durable: {}", durable);
|
||||
PerfBase.logger.info("transacted: {}", transacted);
|
||||
PerfBase.logger.info("batch-size: {}", batchSize);
|
||||
PerfBase.logger.info("drain-queue: {}", drainQueue);
|
||||
PerfBase.logger.info("throttle-rate: {}", throttleRate);
|
||||
PerfBase.logger.info("destination-name: {}", destinationName);
|
||||
PerfBase.logger.info("disable-message-id: {}", disableMessageID);
|
||||
PerfBase.logger.info("disable-message-timestamp: {}", disableTimestamp);
|
||||
PerfBase.logger.info("dups-ok-acknowledge: {}", dupsOK);
|
||||
PerfBase.logger.info("server-uri: {}", uri);
|
||||
PerfBase.logger.info("client-library:{}", clientLibrary);
|
||||
|
||||
PerfParams perfParams = new PerfParams();
|
||||
perfParams.setNoOfMessagesToSend(noOfMessages);
|
||||
|
@ -179,7 +179,7 @@ public abstract class PerfBase {
|
|||
private void displayAverage(final long numberOfMessages, final long start, final long end) {
|
||||
double duration = (1.0 * end - start) / 1000; // in seconds
|
||||
double average = 1.0 * numberOfMessages / duration;
|
||||
PerfBase.log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
|
||||
PerfBase.logger.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
|
||||
}
|
||||
|
||||
protected void runSender() {
|
||||
|
@ -191,9 +191,9 @@ public abstract class PerfBase {
|
|||
}
|
||||
|
||||
start = System.currentTimeMillis();
|
||||
PerfBase.log.info("warming up by sending {} messages", perfParams.getNoOfWarmupMessages());
|
||||
PerfBase.logger.info("warming up by sending {} messages", perfParams.getNoOfWarmupMessages());
|
||||
sendMessages(perfParams.getNoOfWarmupMessages(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), false, perfParams.getThrottleRate(), perfParams.getMessageSize());
|
||||
PerfBase.log.info("warmed up");
|
||||
PerfBase.logger.info("warmed up");
|
||||
start = System.currentTimeMillis();
|
||||
sendMessages(perfParams.getNoOfMessagesToSend(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), true, perfParams.getThrottleRate(), perfParams.getMessageSize());
|
||||
long end = System.currentTimeMillis();
|
||||
|
@ -230,7 +230,7 @@ public abstract class PerfBase {
|
|||
|
||||
connection.start();
|
||||
|
||||
PerfBase.log.info("READY!!!");
|
||||
PerfBase.logger.info("READY!!!");
|
||||
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
consumer.setMessageListener(new PerfListener(countDownLatch, perfParams));
|
||||
|
@ -259,7 +259,7 @@ public abstract class PerfBase {
|
|||
}
|
||||
|
||||
private void drainQueue() throws Exception {
|
||||
PerfBase.log.info("Draining queue");
|
||||
PerfBase.logger.info("Draining queue");
|
||||
|
||||
Session drainSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
||||
|
@ -283,7 +283,7 @@ public abstract class PerfBase {
|
|||
|
||||
drainSession.close();
|
||||
|
||||
PerfBase.log.info("Drained {} messages", count);
|
||||
PerfBase.logger.info("Drained {} messages", count);
|
||||
}
|
||||
|
||||
private void sendMessages(final int numberOfMessages,
|
||||
|
@ -326,7 +326,7 @@ public abstract class PerfBase {
|
|||
|
||||
if (display && i % modulo == 0) {
|
||||
double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
|
||||
PerfBase.log.info(String.format("sent %6d messages in %2.2fs", i, duration));
|
||||
PerfBase.logger.info(String.format("sent %6d messages in %2.2fs", i, duration));
|
||||
}
|
||||
|
||||
if (tbl != null) {
|
||||
|
@ -365,7 +365,7 @@ public abstract class PerfBase {
|
|||
if (warmingUp) {
|
||||
boolean committed = checkCommit();
|
||||
if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages()) {
|
||||
PerfBase.log.info("warmed up after receiving {} msgs", count.longValue());
|
||||
PerfBase.logger.info("warmed up after receiving {} msgs", count.longValue());
|
||||
if (!committed) {
|
||||
checkCommit();
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ public abstract class PerfBase {
|
|||
}
|
||||
if (currentCount % modulo == 0) {
|
||||
double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
|
||||
PerfBase.log.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
|
||||
PerfBase.logger.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SoakBase {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String DEFAULT_SOAK_PROPERTIES_FILE_NAME = "soak.properties";
|
||||
|
||||
|
@ -75,19 +75,19 @@ public class SoakBase {
|
|||
boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
|
||||
boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
|
||||
|
||||
SoakBase.log.info("duration-in-minutes: {}", durationInMinutes);
|
||||
SoakBase.log.info("num-warmup-messages: {}", noOfWarmupMessages);
|
||||
SoakBase.log.info("message-size: {}", messageSize);
|
||||
SoakBase.log.info("durable: {}", durable);
|
||||
SoakBase.log.info("transacted: {}", transacted);
|
||||
SoakBase.log.info("batch-size: {}", batchSize);
|
||||
SoakBase.log.info("drain-queue: {}", drainQueue);
|
||||
SoakBase.log.info("throttle-rate: {}", throttleRate);
|
||||
SoakBase.log.info("connection-factory-lookup: {}", connectionFactoryLookup);
|
||||
SoakBase.log.info("destination-lookup: {}", destinationLookup);
|
||||
SoakBase.log.info("disable-message-id: {}", disableMessageID);
|
||||
SoakBase.log.info("disable-message-timestamp: {}", disableTimestamp);
|
||||
SoakBase.log.info("dups-ok-acknowledge: {}", dupsOK);
|
||||
SoakBase.logger.info("duration-in-minutes: {}", durationInMinutes);
|
||||
SoakBase.logger.info("num-warmup-messages: {}", noOfWarmupMessages);
|
||||
SoakBase.logger.info("message-size: {}", messageSize);
|
||||
SoakBase.logger.info("durable: {}", durable);
|
||||
SoakBase.logger.info("transacted: {}", transacted);
|
||||
SoakBase.logger.info("batch-size: {}", batchSize);
|
||||
SoakBase.logger.info("drain-queue: {}", drainQueue);
|
||||
SoakBase.logger.info("throttle-rate: {}", throttleRate);
|
||||
SoakBase.logger.info("connection-factory-lookup: {}", connectionFactoryLookup);
|
||||
SoakBase.logger.info("destination-lookup: {}", destinationLookup);
|
||||
SoakBase.logger.info("disable-message-id: {}", disableMessageID);
|
||||
SoakBase.logger.info("disable-message-timestamp: {}", disableTimestamp);
|
||||
SoakBase.logger.info("dups-ok-acknowledge: {}", dupsOK);
|
||||
|
||||
SoakParams soakParams = new SoakParams();
|
||||
soakParams.setDurationInMinutes(durationInMinutes);
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
|
||||
public class SoakReceiver {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String EOF = UUID.randomUUID().toString();
|
||||
|
||||
|
@ -96,8 +96,8 @@ public class SoakReceiver {
|
|||
|
||||
try {
|
||||
if (SoakReceiver.EOF.equals(msg.getStringProperty("eof"))) {
|
||||
SoakReceiver.log.info(String.format("Received %s messages in %.2f minutes", count, 1.0 * totalDuration / SoakBase.TO_MILLIS));
|
||||
SoakReceiver.log.info("END OF RUN");
|
||||
SoakReceiver.logger.info(String.format("Received %s messages in %.2f minutes", count, 1.0 * totalDuration / SoakBase.TO_MILLIS));
|
||||
SoakReceiver.logger.info("END OF RUN");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class SoakReceiver {
|
|||
if (count.incrementAndGet() % modulo == 0) {
|
||||
double duration = (1.0 * System.currentTimeMillis() - moduloStart) / 1000;
|
||||
moduloStart = System.currentTimeMillis();
|
||||
SoakReceiver.log.info(String.format("received %s messages in %2.2fs (total: %.0fs)", modulo, duration, totalDuration / 1000.0));
|
||||
SoakReceiver.logger.info(String.format("received %s messages in %2.2fs (total: %.0fs)", modulo, duration, totalDuration / 1000.0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class SoakSender {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static void main(final String[] args) {
|
||||
try {
|
||||
|
@ -120,7 +120,7 @@ public class SoakSender {
|
|||
if (display && count.longValue() % modulo == 0) {
|
||||
double duration = (1.0 * System.currentTimeMillis() - moduleStart) / 1000;
|
||||
moduleStart = System.currentTimeMillis();
|
||||
SoakSender.log.info(String.format("sent %s messages in %2.2fs (time: %.0fs)", modulo, duration, totalDuration / 1000.0));
|
||||
SoakSender.logger.info(String.format("sent %s messages in %2.2fs (time: %.0fs)", modulo, duration, totalDuration / 1000.0));
|
||||
}
|
||||
|
||||
if (tbl != null) {
|
||||
|
@ -135,8 +135,8 @@ public class SoakSender {
|
|||
}
|
||||
}
|
||||
|
||||
SoakSender.log.info(String.format("Sent %s messages in %s minutes", count, perfParams.getDurationInMinutes()));
|
||||
SoakSender.log.info("END OF RUN");
|
||||
SoakSender.logger.info(String.format("Sent %s messages in %s minutes", count, perfParams.getDurationInMinutes()));
|
||||
SoakSender.logger.info("END OF RUN");
|
||||
|
||||
if (connection != null) {
|
||||
connection.close();
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpResource {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected AsyncResult openRequest;
|
||||
protected AsyncResult closeRequest;
|
||||
|
@ -146,7 +146,7 @@ public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpRe
|
|||
endpoint.close();
|
||||
}
|
||||
|
||||
LOG.info("Resource {} was remotely closed", this);
|
||||
logger.info("Resource {} was remotely closed", this);
|
||||
|
||||
connection.fireClientException(error);
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpRe
|
|||
endpoint.close();
|
||||
}
|
||||
|
||||
LOG.info("Resource {} was locally closed", this);
|
||||
logger.info("Resource {} was locally closed", this);
|
||||
|
||||
connection.fireClientException(error);
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpRe
|
|||
public void processRemoteDetach(AmqpConnection connection) throws IOException {
|
||||
doDetachedInspection();
|
||||
if (isAwaitingClose()) {
|
||||
LOG.debug("{} is now closed: ", this);
|
||||
logger.debug("{} is now closed: ", this);
|
||||
closed();
|
||||
} else {
|
||||
remotelyClosed(connection);
|
||||
|
@ -223,11 +223,11 @@ public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpRe
|
|||
public void processRemoteClose(AmqpConnection connection) throws IOException {
|
||||
doClosedInspection();
|
||||
if (isAwaitingClose()) {
|
||||
LOG.debug("{} is now closed: ", this);
|
||||
logger.debug("{} is now closed: ", this);
|
||||
closed();
|
||||
} else if (isAwaitingOpen()) {
|
||||
// Error on Open, create exception and signal failure.
|
||||
LOG.warn("Open of {} failed: ", this);
|
||||
logger.warn("Open of {} failed: ", this);
|
||||
Exception openError;
|
||||
if (hasRemoteError()) {
|
||||
openError = AmqpSupport.convertToException(getEndpoint().getRemoteCondition());
|
||||
|
@ -281,7 +281,7 @@ public abstract class AmqpAbstractResource<E extends Endpoint> implements AmqpRe
|
|||
* to provide additional verification actions or configuration updates.
|
||||
*/
|
||||
protected void doOpenCompletion() {
|
||||
LOG.debug("{} is now open: ", this);
|
||||
logger.debug("{} is now open: ", this);
|
||||
opened();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpClient {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final String username;
|
||||
private final String password;
|
||||
|
@ -70,7 +70,7 @@ public class AmqpClient {
|
|||
|
||||
AmqpConnection connection = createConnection();
|
||||
|
||||
LOG.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
logger.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
connection.connect();
|
||||
|
||||
return connection;
|
||||
|
@ -88,7 +88,7 @@ public class AmqpClient {
|
|||
AmqpConnection connection = createConnection();
|
||||
connection.setNoContainerID();
|
||||
|
||||
LOG.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
logger.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
connection.connect();
|
||||
|
||||
return connection;
|
||||
|
@ -107,7 +107,7 @@ public class AmqpClient {
|
|||
AmqpConnection connection = createConnection();
|
||||
connection.setContainerId(containerId);
|
||||
|
||||
LOG.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
logger.debug("Attempting to create new connection to peer: {}", remoteURI);
|
||||
connection.connect();
|
||||
|
||||
return connection;
|
||||
|
|
|
@ -61,7 +61,7 @@ import io.netty.util.ReferenceCountUtil;
|
|||
|
||||
public class AmqpConnection extends AmqpAbstractResource<Connection> implements NettyTransportListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final NoOpAsyncResult NOOP_REQUEST = new NoOpAsyncResult();
|
||||
|
||||
|
@ -229,7 +229,7 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
|
||||
pumpToProtonTransport(request);
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Caught exception while closing proton connection");
|
||||
logger.debug("Caught exception while closing proton connection");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -241,20 +241,20 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
request.sync(closeTimeout, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Error caught while closing Provider: ", e.getMessage());
|
||||
logger.warn("Error caught while closing Provider: ", e.getMessage());
|
||||
} finally {
|
||||
if (transport != null) {
|
||||
try {
|
||||
transport.close();
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Cuaght exception while closing down Transport: {}", e.getMessage());
|
||||
logger.debug("Cuaght exception while closing down Transport: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
serializer.shutdownNow();
|
||||
try {
|
||||
if (!serializer.awaitTermination(10, TimeUnit.SECONDS)) {
|
||||
LOG.warn("Serializer didn't shutdown cleanly");
|
||||
logger.warn("Serializer didn't shutdown cleanly");
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
@ -549,10 +549,10 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
@Override
|
||||
public void run() {
|
||||
ByteBuffer source = incoming.nioBuffer();
|
||||
LOG.trace("Client Received from Broker {} bytes:", source.remaining());
|
||||
logger.trace("Client Received from Broker {} bytes:", source.remaining());
|
||||
|
||||
if (protonTransport.isClosed()) {
|
||||
LOG.debug("Ignoring incoming data because transport is closed");
|
||||
logger.debug("Ignoring incoming data because transport is closed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -579,7 +579,7 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
|
||||
@Override
|
||||
public void onTransportClosed() {
|
||||
LOG.debug("The transport has unexpectedly closed");
|
||||
logger.debug("The transport has unexpectedly closed");
|
||||
failed(getOpenAbortException());
|
||||
}
|
||||
|
||||
|
@ -607,13 +607,13 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
public void run() {
|
||||
try {
|
||||
if (getEndpoint().getLocalState() != EndpointState.CLOSED) {
|
||||
LOG.debug("Client performing next idle check");
|
||||
logger.debug("Client performing next idle check");
|
||||
// Using nano time since it is not related to the wall clock, which may change
|
||||
long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
|
||||
long deadline = protonTransport.tick(now);
|
||||
pumpToProtonTransport();
|
||||
if (protonTransport.isClosed()) {
|
||||
LOG.debug("Transport closed after inactivity check.");
|
||||
logger.debug("Transport closed after inactivity check.");
|
||||
throw new IllegalStateException("Channel was inactive for too long");
|
||||
} else {
|
||||
if (deadline != 0) {
|
||||
|
@ -672,7 +672,7 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
Event protonEvent = null;
|
||||
while ((protonEvent = protonCollector.peek()) != null) {
|
||||
if (!protonEvent.getType().equals(Type.TRANSPORT)) {
|
||||
LOG.trace("Client: New Proton Event: {}", protonEvent.getType());
|
||||
logger.trace("Client: New Proton Event: {}", protonEvent.getType());
|
||||
}
|
||||
|
||||
AmqpEventSink amqpEventSink = null;
|
||||
|
@ -725,7 +725,7 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
|
|||
processSaslAuthentication();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LOG.warn("Caught Exception during update processing: {}", ex.getMessage(), ex);
|
||||
logger.warn("Caught Exception during update processing: {}", ex.getMessage(), ex);
|
||||
fireClientException(ex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final AtomicBoolean closed = new AtomicBoolean();
|
||||
private final BlockingQueue<AmqpMessage> prefetch = new LinkedBlockingDeque<>();
|
||||
|
@ -318,11 +318,11 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
long timeoutMills = unit.toMillis(timeout);
|
||||
|
||||
try {
|
||||
LOG.trace("Pull on Receiver {} with timeout = {}", getSubscriptionName(), timeoutMills);
|
||||
logger.trace("Pull on Receiver {} with timeout = {}", getSubscriptionName(), timeoutMills);
|
||||
if (timeoutMills < 0) {
|
||||
// Wait until message arrives. Just give credit if needed.
|
||||
if (getEndpoint().getCredit() == 0) {
|
||||
LOG.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
logger.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
getEndpoint().flow(1);
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
// try to fulfill the request, then drain down what is there to
|
||||
// ensure we consume what is available and remove all credit.
|
||||
if (getEndpoint().getCredit() == 0) {
|
||||
LOG.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
logger.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
getEndpoint().flow(1);
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
// try to fulfill the request, then drain down what is there to
|
||||
// ensure we consume what is available and remove all credit.
|
||||
if (getEndpoint().getCredit() == 0) {
|
||||
LOG.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
logger.trace("Receiver {} granting 1 additional credit for pull.", getSubscriptionName());
|
||||
getEndpoint().flow(1);
|
||||
}
|
||||
|
||||
|
@ -904,7 +904,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
incoming = getEndpoint().current();
|
||||
if (incoming != null) {
|
||||
if (incoming.isReadable() && !incoming.isPartial()) {
|
||||
LOG.trace("{} has incoming Message(s).", this);
|
||||
logger.trace("{} has incoming Message(s).", this);
|
||||
try {
|
||||
processDelivery(incoming);
|
||||
} catch (Exception e) {
|
||||
|
@ -912,7 +912,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
}
|
||||
getEndpoint().advance();
|
||||
} else {
|
||||
LOG.trace("{} has a partial incoming Message(s), deferring.", this);
|
||||
logger.trace("{} has a partial incoming Message(s), deferring.", this);
|
||||
incoming = null;
|
||||
}
|
||||
} else {
|
||||
|
@ -938,7 +938,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
try {
|
||||
message = decodeIncomingMessage(incoming);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error on transform: {}", e.getMessage());
|
||||
logger.warn("Error on transform: {}", e.getMessage());
|
||||
deliveryFailed(incoming, true);
|
||||
return;
|
||||
}
|
||||
|
@ -981,7 +981,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
}
|
||||
}
|
||||
|
||||
LOG.trace("Consumer {} flow updated, remote credit = {}", getSubscriptionName(), getEndpoint().getRemoteCredit());
|
||||
logger.trace("Consumer {} flow updated, remote credit = {}", getSubscriptionName(), getEndpoint().getRemoteCredit());
|
||||
|
||||
super.processFlowUpdates(connection);
|
||||
}
|
||||
|
@ -1046,7 +1046,7 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
final ScheduledFuture<?> future = getSession().getScheduler().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LOG.trace("Consumer {} drain request timed out", this);
|
||||
logger.trace("Consumer {} drain request timed out", this);
|
||||
Exception cause = new AmqpOperationTimedOutException("Remote did not respond to a drain request in time");
|
||||
locallyClosed(session.getConnection(), cause);
|
||||
stopRequest.onFailure(cause);
|
||||
|
@ -1060,12 +1060,12 @@ public class AmqpReceiver extends AmqpAbstractResource<Receiver> {
|
|||
}
|
||||
|
||||
private void stopOnSchedule(long timeout, final AsyncResult request) {
|
||||
LOG.trace("Receiver {} scheduling stop", this);
|
||||
logger.trace("Receiver {} scheduling stop", this);
|
||||
// We need to drain the credit if no message(s) arrive to use it.
|
||||
final ScheduledFuture<?> future = getSession().getScheduler().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LOG.trace("Receiver {} running scheduled stop", this);
|
||||
logger.trace("Receiver {} running scheduled stop", this);
|
||||
if (getEndpoint().getRemoteCredit() != 0) {
|
||||
stop(request);
|
||||
session.pumpToProtonTransport(request);
|
||||
|
|
|
@ -56,7 +56,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpSender extends AmqpAbstractResource<Sender> {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {};
|
||||
|
||||
public static final long DEFAULT_SEND_TIMEOUT = 15000;
|
||||
|
@ -434,7 +434,7 @@ public class AmqpSender extends AmqpAbstractResource<Sender> {
|
|||
}
|
||||
|
||||
private void doSend(AmqpMessage message, AsyncResult request, AmqpTransactionId txId) throws Exception {
|
||||
LOG.trace("Producer sending message: {}", message);
|
||||
logger.trace("Producer sending message: {}", message);
|
||||
|
||||
Delivery delivery = null;
|
||||
if (presettle) {
|
||||
|
@ -492,14 +492,14 @@ public class AmqpSender extends AmqpAbstractResource<Sender> {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
LOG.warn("{} failed to send any data from current Message.", this);
|
||||
logger.warn("{} failed to send any data from current Message.", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processFlowUpdates(AmqpConnection connection) throws IOException {
|
||||
LOG.trace("Sender {} flow update, credit = {}", getEndpoint().getCredit());
|
||||
logger.trace("Sender {} flow update, credit = {}", getEndpoint().getCredit());
|
||||
|
||||
doCreditInspection();
|
||||
}
|
||||
|
@ -518,12 +518,12 @@ public class AmqpSender extends AmqpAbstractResource<Sender> {
|
|||
|
||||
Outcome outcome = null;
|
||||
if (state instanceof TransactionalState) {
|
||||
LOG.trace("State of delivery is Transactional, retrieving outcome: {}", state);
|
||||
logger.trace("State of delivery is Transactional, retrieving outcome: {}", state);
|
||||
outcome = ((TransactionalState) state).getOutcome();
|
||||
} else if (state instanceof Outcome) {
|
||||
outcome = (Outcome) state;
|
||||
} else {
|
||||
LOG.warn("Message send updated with unsupported state: {}", state);
|
||||
logger.warn("Message send updated with unsupported state: {}", state);
|
||||
outcome = null;
|
||||
}
|
||||
|
||||
|
@ -531,12 +531,12 @@ public class AmqpSender extends AmqpAbstractResource<Sender> {
|
|||
Exception deliveryError = null;
|
||||
|
||||
if (outcome instanceof Accepted) {
|
||||
LOG.trace("Outcome of delivery was accepted: {}", delivery);
|
||||
logger.trace("Outcome of delivery was accepted: {}", delivery);
|
||||
if (request != null && !request.isComplete()) {
|
||||
request.onSuccess();
|
||||
}
|
||||
} else if (outcome instanceof Rejected) {
|
||||
LOG.trace("Outcome of delivery was rejected: {}", delivery);
|
||||
logger.trace("Outcome of delivery was rejected: {}", delivery);
|
||||
ErrorCondition remoteError = ((Rejected) outcome).getError();
|
||||
if (remoteError == null) {
|
||||
remoteError = getEndpoint().getRemoteCondition();
|
||||
|
@ -544,10 +544,10 @@ public class AmqpSender extends AmqpAbstractResource<Sender> {
|
|||
|
||||
deliveryError = AmqpSupport.convertToException(remoteError);
|
||||
} else if (outcome instanceof Released) {
|
||||
LOG.trace("Outcome of delivery was released: {}", delivery);
|
||||
logger.trace("Outcome of delivery was released: {}", delivery);
|
||||
deliveryError = new IOException("Delivery failed: released by receiver");
|
||||
} else if (outcome instanceof Modified) {
|
||||
LOG.trace("Outcome of delivery was modified: {}", delivery);
|
||||
logger.trace("Outcome of delivery was modified: {}", delivery);
|
||||
deliveryError = new IOException("Delivery failed: failure at remote");
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpTransactionContext {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final AmqpSession session;
|
||||
private final Set<AmqpReceiver> txReceivers = new LinkedHashSet<>();
|
||||
|
@ -69,21 +69,21 @@ public class AmqpTransactionContext {
|
|||
}
|
||||
});
|
||||
|
||||
LOG.info("Attempting to Begin TX:[{}]", txId);
|
||||
logger.info("Attempting to Begin TX:[{}]", txId);
|
||||
|
||||
session.getScheduler().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (coordinator == null || coordinator.isClosed()) {
|
||||
LOG.info("Creating new Coordinator for TX:[{}]", txId);
|
||||
logger.info("Creating new Coordinator for TX:[{}]", txId);
|
||||
coordinator = new AmqpTransactionCoordinator(session);
|
||||
coordinator.open(new AsyncResult() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
try {
|
||||
LOG.info("Attempting to declare TX:[{}]", txId);
|
||||
logger.info("Attempting to declare TX:[{}]", txId);
|
||||
coordinator.declare(txId, request);
|
||||
} catch (Exception e) {
|
||||
request.onFailure(e);
|
||||
|
@ -102,7 +102,7 @@ public class AmqpTransactionContext {
|
|||
});
|
||||
} else {
|
||||
try {
|
||||
LOG.info("Attempting to declare TX:[{}]", txId);
|
||||
logger.info("Attempting to declare TX:[{}]", txId);
|
||||
coordinator.declare(txId, request);
|
||||
} catch (Exception e) {
|
||||
request.onFailure(e);
|
||||
|
@ -143,13 +143,13 @@ public class AmqpTransactionContext {
|
|||
}
|
||||
});
|
||||
|
||||
LOG.debug("Commit on TX[{}] initiated", transactionId);
|
||||
logger.debug("Commit on TX[{}] initiated", transactionId);
|
||||
session.getScheduler().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
LOG.info("Attempting to commit TX:[{}]", transactionId);
|
||||
logger.info("Attempting to commit TX:[{}]", transactionId);
|
||||
coordinator.discharge(transactionId, request, true);
|
||||
session.pumpToProtonTransport(request);
|
||||
} catch (Exception e) {
|
||||
|
@ -188,13 +188,13 @@ public class AmqpTransactionContext {
|
|||
}
|
||||
});
|
||||
|
||||
LOG.debug("Rollback on TX[{}] initiated", transactionId);
|
||||
logger.debug("Rollback on TX[{}] initiated", transactionId);
|
||||
session.getScheduler().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
LOG.info("Attempting to roll back TX:[{}]", transactionId);
|
||||
logger.info("Attempting to roll back TX:[{}]", transactionId);
|
||||
coordinator.discharge(transactionId, request, false);
|
||||
session.pumpToProtonTransport(request);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -54,7 +54,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpTransactionCoordinator extends AmqpAbstractResource<Sender> {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final byte[] OUTBOUND_BUFFER = new byte[64];
|
||||
|
||||
|
@ -87,12 +87,12 @@ public class AmqpTransactionCoordinator extends AmqpAbstractResource<Sender> {
|
|||
}
|
||||
|
||||
if (state instanceof Declared) {
|
||||
LOG.debug("New TX started: {}", txId.getTxId());
|
||||
logger.debug("New TX started: {}", txId.getTxId());
|
||||
Declared declared = (Declared) state;
|
||||
txId.setRemoteTxId(declared.getTxnId());
|
||||
pendingRequest.onSuccess();
|
||||
} else if (state instanceof Rejected) {
|
||||
LOG.debug("Last TX request failed: {}", txId.getTxId());
|
||||
logger.debug("Last TX request failed: {}", txId.getTxId());
|
||||
Rejected rejected = (Rejected) state;
|
||||
Exception cause = AmqpSupport.convertToException(rejected.getError());
|
||||
JMSException failureCause = null;
|
||||
|
@ -104,7 +104,7 @@ public class AmqpTransactionCoordinator extends AmqpAbstractResource<Sender> {
|
|||
|
||||
pendingRequest.onFailure(failureCause);
|
||||
} else {
|
||||
LOG.debug("Last TX request succeeded: {}", txId.getTxId());
|
||||
logger.debug("Last TX request succeeded: {}", txId.getTxId());
|
||||
pendingRequest.onSuccess();
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class AmqpTransactionCoordinator extends AmqpAbstractResource<Sender> {
|
|||
getEndpoint().free();
|
||||
}
|
||||
|
||||
LOG.debug("Transaction Coordinator link {} was remotely closed", getEndpoint());
|
||||
logger.debug("Transaction Coordinator link {} was remotely closed", getEndpoint());
|
||||
}
|
||||
|
||||
//----- Internal implementation ------------------------------------------//
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class SaslAuthenticator {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final Sasl sasl;
|
||||
private final String username;
|
||||
|
@ -121,7 +121,7 @@ public class SaslAuthenticator {
|
|||
|
||||
for (String remoteMechanism : remoteMechanisms) {
|
||||
if (mechanismRestriction != null && !mechanismRestriction.equals(remoteMechanism)) {
|
||||
LOG.debug("Skipping {} mechanism because it is not the configured mechanism restriction {}", remoteMechanism, mechanismRestriction);
|
||||
logger.debug("Skipping {} mechanism because it is not the configured mechanism restriction {}", remoteMechanism, mechanismRestriction);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class SaslAuthenticator {
|
|||
} else if (remoteMechanism.equalsIgnoreCase("CRAM-MD5")) {
|
||||
mechanism = new CramMD5Mechanism();
|
||||
} else {
|
||||
LOG.debug("Unknown remote mechanism {}, skipping", remoteMechanism);
|
||||
logger.debug("Unknown remote mechanism {}, skipping", remoteMechanism);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class SaslAuthenticator {
|
|||
match = found.get(found.size() - 1);
|
||||
}
|
||||
|
||||
LOG.info("Best match for SASL auth was: {}", match);
|
||||
logger.info("Best match for SASL auth was: {}", match);
|
||||
|
||||
return match;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class IdGenerator {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final String UNIQUE_STUB;
|
||||
private static int instanceCount;
|
||||
private static String hostName;
|
||||
|
@ -57,16 +57,16 @@ public class IdGenerator {
|
|||
ServerSocket ss = null;
|
||||
try {
|
||||
idGeneratorPort = Integer.parseInt(System.getProperty(PROPERTY_IDGENERATOR_PORT, "0"));
|
||||
LOG.trace("Using port {}", idGeneratorPort);
|
||||
logger.trace("Using port {}", idGeneratorPort);
|
||||
hostName = getLocalHostName();
|
||||
ss = new ServerSocket(idGeneratorPort);
|
||||
stub = "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-";
|
||||
Thread.sleep(100);
|
||||
} catch (Exception e) {
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("could not generate unique stub by using DNS and binding to local port", e);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("could not generate unique stub by using DNS and binding to local port", e);
|
||||
} else {
|
||||
LOG.warn("could not generate unique stub by using DNS and binding to local port: {} {}", e.getClass().getCanonicalName(), e.getMessage());
|
||||
logger.warn("could not generate unique stub by using DNS and binding to local port: {} {}", e.getClass().getCanonicalName(), e.getMessage());
|
||||
}
|
||||
|
||||
// Restore interrupted state so higher level code can deal with it.
|
||||
|
@ -78,10 +78,10 @@ public class IdGenerator {
|
|||
try {
|
||||
ss.close();
|
||||
} catch (IOException ioe) {
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("Closing the server socket failed", ioe);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Closing the server socket failed", ioe);
|
||||
} else {
|
||||
LOG.warn("Closing the server socket failed due to {}", ioe.getMessage());
|
||||
logger.warn("Closing the server socket failed due to {}", ioe.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public class IdGenerator {
|
|||
|
||||
if (changed) {
|
||||
String newHost = sb.toString();
|
||||
LOG.info("Sanitized hostname from: {} to: {}", hostName, newHost);
|
||||
logger.info("Sanitized hostname from: {} to: {}", hostName, newHost);
|
||||
return newHost;
|
||||
} else {
|
||||
return hostName;
|
||||
|
|
|
@ -57,7 +57,7 @@ import io.netty.util.concurrent.GenericFutureListener;
|
|||
*/
|
||||
public class NettyTcpTransport implements NettyTransport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int SHUTDOWN_TIMEOUT = 100;
|
||||
public static final int DEFAULT_MAX_FRAME_SIZE = 65535;
|
||||
|
@ -158,7 +158,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
try {
|
||||
connectLatch.await();
|
||||
} catch (InterruptedException ex) {
|
||||
LOG.debug("Transport connection was interrupted.");
|
||||
logger.debug("Transport connection was interrupted.");
|
||||
Thread.interrupted();
|
||||
failureCause = IOExceptionSupport.create(ex);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
if (group != null) {
|
||||
Future<?> fut = group.shutdownGracefully(0, SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);
|
||||
if (!fut.awaitUninterruptibly(2 * SHUTDOWN_TIMEOUT)) {
|
||||
LOG.trace("Channel group shutdown failed to complete in allotted time");
|
||||
logger.trace("Channel group shutdown failed to complete in allotted time");
|
||||
}
|
||||
group = null;
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
if (group != null) {
|
||||
Future<?> fut = group.shutdownGracefully(0, SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);
|
||||
if (!fut.awaitUninterruptibly(2 * SHUTDOWN_TIMEOUT)) {
|
||||
LOG.trace("Channel group shutdown failed to complete in allotted time");
|
||||
logger.trace("Channel group shutdown failed to complete in allotted time");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
return null;
|
||||
}
|
||||
|
||||
LOG.trace("Attempted write of: {} bytes", length);
|
||||
logger.trace("Attempted write of: {} bytes", length);
|
||||
|
||||
return channel.writeAndFlush(bufferTransformer.apply(output), promise);
|
||||
}
|
||||
|
@ -328,22 +328,22 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
// ----- Event Handlers which can be overridden in subclasses -------------//
|
||||
|
||||
protected void handleConnected(Channel channel) throws Exception {
|
||||
LOG.trace("Channel has become active! Channel is {}", channel);
|
||||
logger.trace("Channel has become active! Channel is {}", channel);
|
||||
connectionEstablished(channel);
|
||||
}
|
||||
|
||||
protected void handleChannelInactive(Channel channel) throws Exception {
|
||||
LOG.trace("Channel has gone inactive! Channel is {}", channel);
|
||||
logger.trace("Channel has gone inactive! Channel is {}", channel);
|
||||
if (connected.compareAndSet(true, false) && !closed.get()) {
|
||||
LOG.trace("Firing onTransportClosed listener");
|
||||
logger.trace("Firing onTransportClosed listener");
|
||||
listener.onTransportClosed();
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleException(Channel channel, Throwable cause) throws Exception {
|
||||
LOG.trace("Exception on channel! Channel is {}", channel);
|
||||
logger.trace("Exception on channel! Channel is {}", channel);
|
||||
if (connected.compareAndSet(true, false) && !closed.get()) {
|
||||
LOG.trace("Firing onTransportError listener");
|
||||
logger.trace("Firing onTransportError listener");
|
||||
if (failureCause != null) {
|
||||
listener.onTransportError(failureCause);
|
||||
} else {
|
||||
|
@ -353,7 +353,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
// Hold the first failure for later dispatch if connect succeeds.
|
||||
// This will then trigger disconnect using the first error reported.
|
||||
if (failureCause == null) {
|
||||
LOG.trace("Holding error until connect succeeds: {}", cause.getMessage());
|
||||
logger.trace("Holding error until connect succeeds: {}", cause.getMessage());
|
||||
failureCause = IOExceptionSupport.create(cause);
|
||||
}
|
||||
|
||||
|
@ -447,10 +447,10 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
@Override
|
||||
public void operationComplete(Future<Channel> future) throws Exception {
|
||||
if (future.isSuccess()) {
|
||||
LOG.trace("SSL Handshake has completed: {}", channel);
|
||||
logger.trace("SSL Handshake has completed: {}", channel);
|
||||
handleConnected(channel);
|
||||
} else {
|
||||
LOG.trace("SSL Handshake has failed: {}", channel);
|
||||
logger.trace("SSL Handshake has failed: {}", channel);
|
||||
handleException(channel, future.cause());
|
||||
}
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ public class NettyTcpTransport implements NettyTransport {
|
|||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||
LOG.trace("New data read: {} bytes incoming: {}", buffer.readableBytes(), buffer);
|
||||
logger.trace("New data read: {} bytes incoming: {}", buffer.readableBytes(), buffer);
|
||||
listener.onData(buffer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ import io.netty.handler.ssl.SslHandler;
|
|||
*/
|
||||
public class NettyTransportSupport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* Creates a Netty SslHandler instance for use in Transports that require an SSL encoder /
|
||||
|
@ -85,7 +85,7 @@ public class NettyTransportSupport {
|
|||
public static SSLContext createSslContext(NettyTransportSslOptions options) throws Exception {
|
||||
try {
|
||||
String contextProtocol = options.getContextProtocol();
|
||||
LOG.trace("Getting SSLContext instance using protocol: {}", contextProtocol);
|
||||
logger.trace("Getting SSLContext instance using protocol: {}", contextProtocol);
|
||||
|
||||
SSLContext context = SSLContext.getInstance(contextProtocol);
|
||||
KeyManager[] keyMgrs = loadKeyManagers(options);
|
||||
|
@ -94,7 +94,7 @@ public class NettyTransportSupport {
|
|||
context.init(keyMgrs, trustManagers, new SecureRandom());
|
||||
return context;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Failed to create SSLContext: {}", e, e);
|
||||
logger.error("Failed to create SSLContext: {}", e, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
@ -160,22 +160,22 @@ public class NettyTransportSupport {
|
|||
|
||||
if (options.getEnabledProtocols() != null) {
|
||||
List<String> configuredProtocols = Arrays.asList(options.getEnabledProtocols());
|
||||
LOG.trace("Configured protocols from transport options: {}", configuredProtocols);
|
||||
logger.trace("Configured protocols from transport options: {}", configuredProtocols);
|
||||
enabledProtocols.addAll(configuredProtocols);
|
||||
} else {
|
||||
List<String> engineProtocols = Arrays.asList(engine.getEnabledProtocols());
|
||||
LOG.trace("Default protocols from the SSLEngine: {}", engineProtocols);
|
||||
logger.trace("Default protocols from the SSLEngine: {}", engineProtocols);
|
||||
enabledProtocols.addAll(engineProtocols);
|
||||
}
|
||||
|
||||
String[] disabledProtocols = options.getDisabledProtocols();
|
||||
if (disabledProtocols != null) {
|
||||
List<String> disabled = Arrays.asList(disabledProtocols);
|
||||
LOG.trace("Disabled protocols: {}", disabled);
|
||||
logger.trace("Disabled protocols: {}", disabled);
|
||||
enabledProtocols.removeAll(disabled);
|
||||
}
|
||||
|
||||
LOG.trace("Enabled protocols: {}", enabledProtocols);
|
||||
logger.trace("Enabled protocols: {}", enabledProtocols);
|
||||
|
||||
return enabledProtocols.toArray(new String[0]);
|
||||
}
|
||||
|
@ -185,22 +185,22 @@ public class NettyTransportSupport {
|
|||
|
||||
if (options.getEnabledCipherSuites() != null) {
|
||||
List<String> configuredCipherSuites = Arrays.asList(options.getEnabledCipherSuites());
|
||||
LOG.trace("Configured cipher suites from transport options: {}", configuredCipherSuites);
|
||||
logger.trace("Configured cipher suites from transport options: {}", configuredCipherSuites);
|
||||
enabledCipherSuites.addAll(configuredCipherSuites);
|
||||
} else {
|
||||
List<String> engineCipherSuites = Arrays.asList(engine.getEnabledCipherSuites());
|
||||
LOG.trace("Default cipher suites from the SSLEngine: {}", engineCipherSuites);
|
||||
logger.trace("Default cipher suites from the SSLEngine: {}", engineCipherSuites);
|
||||
enabledCipherSuites.addAll(engineCipherSuites);
|
||||
}
|
||||
|
||||
String[] disabledCipherSuites = options.getDisabledCipherSuites();
|
||||
if (disabledCipherSuites != null) {
|
||||
List<String> disabled = Arrays.asList(disabledCipherSuites);
|
||||
LOG.trace("Disabled cipher suites: {}", disabled);
|
||||
logger.trace("Disabled cipher suites: {}", disabled);
|
||||
enabledCipherSuites.removeAll(disabled);
|
||||
}
|
||||
|
||||
LOG.trace("Enabled cipher suites: {}", enabledCipherSuites);
|
||||
logger.trace("Enabled cipher suites: {}", enabledCipherSuites);
|
||||
|
||||
return enabledCipherSuites.toArray(new String[0]);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ public class NettyTransportSupport {
|
|||
String storePassword = options.getTrustStorePassword();
|
||||
String storeType = options.getStoreType();
|
||||
|
||||
LOG.trace("Attempt to load TrustStore from location {} of type {}", storeLocation, storeType);
|
||||
logger.trace("Attempt to load TrustStore from location {} of type {}", storeLocation, storeType);
|
||||
|
||||
KeyStore trustStore = loadStore(storeLocation, storePassword, storeType);
|
||||
fact.init(trustStore);
|
||||
|
@ -240,7 +240,7 @@ public class NettyTransportSupport {
|
|||
String storeType = options.getStoreType();
|
||||
String alias = options.getKeyAlias();
|
||||
|
||||
LOG.trace("Attempt to load KeyStore from location {} of type {}", storeLocation, storeType);
|
||||
logger.trace("Attempt to load KeyStore from location {} of type {}", storeLocation, storeType);
|
||||
|
||||
KeyStore keyStore = loadStore(storeLocation, storePassword, storeType);
|
||||
fact.init(keyStore, storePassword != null ? storePassword.toCharArray() : null);
|
||||
|
|
|
@ -50,7 +50,7 @@ import io.netty.handler.codec.http.websocketx.WebSocketVersion;
|
|||
*/
|
||||
public class NettyWSTransport extends NettyTcpTransport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String AMQP_SUB_PROTOCOL = "amqp";
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class NettyWSTransport extends NettyTcpTransport {
|
|||
|
||||
@Override
|
||||
protected void handleConnected(Channel channel) throws Exception {
|
||||
LOG.trace("Channel has become active, awaiting WebSocket handshake! Channel is {}", channel);
|
||||
logger.trace("Channel has become active, awaiting WebSocket handshake! Channel is {}", channel);
|
||||
}
|
||||
|
||||
// ----- Handle connection events -----------------------------------------//
|
||||
|
@ -127,12 +127,12 @@ public class NettyWSTransport extends NettyTcpTransport {
|
|||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Object message) throws Exception {
|
||||
LOG.trace("New data read: incoming: {}", message);
|
||||
logger.trace("New data read: incoming: {}", message);
|
||||
|
||||
Channel ch = ctx.channel();
|
||||
if (!handshaker.isHandshakeComplete()) {
|
||||
handshaker.finishHandshake(ch, (FullHttpResponse) message);
|
||||
LOG.trace("WebSocket Client connected! {}", ctx.channel());
|
||||
logger.trace("WebSocket Client connected! {}", ctx.channel());
|
||||
// Now trigger super processing as we are really connected.
|
||||
NettyWSTransport.super.handleConnected(ch);
|
||||
return;
|
||||
|
@ -148,21 +148,21 @@ public class NettyWSTransport extends NettyTcpTransport {
|
|||
WebSocketFrame frame = (WebSocketFrame) message;
|
||||
if (frame instanceof TextWebSocketFrame) {
|
||||
TextWebSocketFrame textFrame = (TextWebSocketFrame) frame;
|
||||
LOG.warn("WebSocket Client received message: {}", textFrame.text());
|
||||
logger.warn("WebSocket Client received message: {}", textFrame.text());
|
||||
ctx.fireExceptionCaught(new IOException("Received invalid frame over WebSocket."));
|
||||
} else if (frame instanceof BinaryWebSocketFrame) {
|
||||
BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame;
|
||||
LOG.trace("WebSocket Client received data: {} bytes", binaryFrame.content().readableBytes());
|
||||
logger.trace("WebSocket Client received data: {} bytes", binaryFrame.content().readableBytes());
|
||||
listener.onData(binaryFrame.content());
|
||||
} else if (frame instanceof ContinuationWebSocketFrame) {
|
||||
ContinuationWebSocketFrame continuationFrame = (ContinuationWebSocketFrame) frame;
|
||||
LOG.trace("WebSocket Client received data continuation: {} bytes", continuationFrame.content().readableBytes());
|
||||
logger.trace("WebSocket Client received data continuation: {} bytes", continuationFrame.content().readableBytes());
|
||||
listener.onData(continuationFrame.content());
|
||||
} else if (frame instanceof PingWebSocketFrame) {
|
||||
LOG.trace("WebSocket Client received ping, response with pong");
|
||||
logger.trace("WebSocket Client received ping, response with pong");
|
||||
ch.write(new PongWebSocketFrame(frame.content()));
|
||||
} else if (frame instanceof CloseWebSocketFrame) {
|
||||
LOG.trace("WebSocket Client received closing");
|
||||
logger.trace("WebSocket Client received closing");
|
||||
ch.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpDurableReceiverTest extends AmqpClientTestSupport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final String SELECTOR_STRING = "color = red";
|
||||
|
||||
|
@ -342,7 +342,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport {
|
|||
session.lookupSubscription(getSubscriptionName());
|
||||
fail("Should throw an exception since there is not subscription");
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Error on lookup: {}", e.getMessage());
|
||||
logger.debug("Error on lookup: {}", e.getMessage());
|
||||
}
|
||||
|
||||
connection.close();
|
||||
|
|
|
@ -50,7 +50,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpInboundConnectionTest extends AmqpClientTestSupport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String BROKER_NAME = "localhost";
|
||||
private static final String PRODUCT_NAME = "apache-activemq-artemis";
|
||||
|
@ -286,7 +286,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport {
|
|||
connection2.connect();
|
||||
fail("Should not be able to connect with same container Id.");
|
||||
} catch (Exception ex) {
|
||||
LOG.debug("Second connection with same container Id failed as expected.");
|
||||
logger.debug("Second connection with same container Id failed as expected.");
|
||||
}
|
||||
|
||||
connection2.getStateInspector().assertValid();
|
||||
|
|
|
@ -78,7 +78,7 @@ import java.lang.invoke.MethodHandles;
|
|||
@RunWith(Parameterized.class)
|
||||
public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final Random rand = new Random(System.currentTimeMillis());
|
||||
|
||||
|
@ -312,7 +312,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
if (wrapped.getBody() instanceof Data) {
|
||||
// converters can change this to AmqValue
|
||||
Data data = (Data) wrapped.getBody();
|
||||
LOG.debug("received : message: {}", data.getValue().getLength());
|
||||
logger.debug("received : message: {}", data.getValue().getLength());
|
||||
assertEquals(payload, data.getValue().getLength());
|
||||
}
|
||||
message.accept();
|
||||
|
@ -366,7 +366,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
MessageImpl wrapped = (MessageImpl) message.getWrappedMessage();
|
||||
if (wrapped.getBody() instanceof Data) {
|
||||
Data data = (Data) wrapped.getBody();
|
||||
LOG.debug("received : message: {}", data.getValue().getLength());
|
||||
logger.debug("received : message: {}", data.getValue().getLength());
|
||||
assertEquals(payload, data.getValue().getLength());
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
payload[i] = (byte) rand.nextInt(256);
|
||||
}
|
||||
|
||||
LOG.debug("Created buffer with size : {} bytes", sizeInBytes);
|
||||
logger.debug("Created buffer with size : {} bytes", sizeInBytes);
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
}
|
||||
|
||||
public void doTestSendLargeMessage(int expectedSize) throws Exception {
|
||||
LOG.debug("doTestSendLargeMessage called with expectedSize {}", expectedSize);
|
||||
logger.debug("doTestSendLargeMessage called with expectedSize {}", expectedSize);
|
||||
byte[] payload = createLargePayload(expectedSize);
|
||||
assertEquals(expectedSize, payload.length);
|
||||
|
||||
|
@ -572,12 +572,12 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
producer.send(message);
|
||||
long endTime = System.currentTimeMillis();
|
||||
|
||||
LOG.debug("Returned from send after {} ms", endTime - startTime);
|
||||
logger.debug("Returned from send after {} ms", endTime - startTime);
|
||||
startTime = System.currentTimeMillis();
|
||||
MessageConsumer consumer = session.createConsumer(queue);
|
||||
connection.start();
|
||||
|
||||
LOG.debug("Calling receive");
|
||||
logger.debug("Calling receive");
|
||||
Message received = consumer.receive();
|
||||
assertNotNull(received);
|
||||
assertTrue(received instanceof BytesMessage);
|
||||
|
@ -585,7 +585,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
assertNotNull(bytesMessage);
|
||||
endTime = System.currentTimeMillis();
|
||||
|
||||
LOG.debug("Returned from receive after {} ms", endTime - startTime);
|
||||
logger.debug("Returned from receive after {} ms", endTime - startTime);
|
||||
byte[] bytesReceived = new byte[expectedSize];
|
||||
assertEquals(expectedSize, bytesMessage.readBytes(bytesReceived, expectedSize));
|
||||
assertTrue(Arrays.equals(payload, bytesReceived));
|
||||
|
@ -729,27 +729,27 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
boolean timeRemaining = true;
|
||||
while (timeRemaining) {
|
||||
if (messagesA.size() < numMsgs) {
|
||||
LOG.debug("Attempting to receive message for receiver A");
|
||||
logger.debug("Attempting to receive message for receiver A");
|
||||
AmqpMessage messageA = receiverA.receive(20, TimeUnit.MILLISECONDS);
|
||||
if (messageA != null) {
|
||||
LOG.debug("Got message for receiver A");
|
||||
logger.debug("Got message for receiver A");
|
||||
messagesA.add(messageA);
|
||||
messageA.accept();
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesB.size() < numMsgs) {
|
||||
LOG.debug("Attempting to receive message for receiver B");
|
||||
logger.debug("Attempting to receive message for receiver B");
|
||||
AmqpMessage messageB = receiverB.receive(20, TimeUnit.MILLISECONDS);
|
||||
if (messageB != null) {
|
||||
LOG.debug("Got message for receiver B");
|
||||
logger.debug("Got message for receiver B");
|
||||
messagesB.add(messageB);
|
||||
messageB.accept();
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesA.size() == numMsgs && messagesB.size() == numMsgs) {
|
||||
LOG.debug("Received expected messages");
|
||||
logger.debug("Received expected messages");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private boolean maxFrameSizeConfigSet = false;
|
||||
private static final int CONFIGURED_FRAME_SIZE = 4321;
|
||||
|
@ -182,7 +182,7 @@ public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport {
|
|||
|
||||
verifyMessage(receivedMessage, payloadSize);
|
||||
|
||||
LOG.trace("received : message {}", i);
|
||||
logger.trace("received : message {}", i);
|
||||
receivedMessage.accept();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpMessagePriorityTest extends AmqpClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test(timeout = 60000)
|
||||
public void testMessageDefaultPriority() throws Exception {
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AmqpSessionTest extends AmqpClientTestSupport {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test(timeout = 60000)
|
||||
public void testCreateSession() throws Exception {
|
||||
|
@ -54,7 +54,7 @@ public class AmqpSessionTest extends AmqpClientTestSupport {
|
|||
|
||||
@Override
|
||||
public void inspectClosedResource(Session session) {
|
||||
log.debug("Session closed: {}", session.getContext());
|
||||
logger.debug("Session closed: {}", session.getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AmqpTempDestinationTest extends AmqpClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test(timeout = 60000)
|
||||
public void testCreateDynamicSenderToTopic() throws Exception {
|
||||
|
@ -210,7 +210,7 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport {
|
|||
|
||||
// Get the new address
|
||||
String address = sender.getSender().getRemoteTarget().getAddress();
|
||||
LOG.debug("New dynamic sender address -> {}", address);
|
||||
logger.debug("New dynamic sender address -> {}", address);
|
||||
|
||||
// Create a message and send to a receive that is listening on the newly
|
||||
// created dynamic link address.
|
||||
|
@ -259,7 +259,7 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport {
|
|||
|
||||
// Get the new address
|
||||
String address = receiver.getReceiver().getRemoteSource().getAddress();
|
||||
LOG.debug("New dynamic receiver address -> {}", address);
|
||||
logger.debug("New dynamic receiver address -> {}", address);
|
||||
|
||||
// Create a message and send to a receive that is listening on the newly
|
||||
// created dynamic link address.
|
||||
|
|
|
@ -56,7 +56,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class JMSMessageConsumerTest extends JMSClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected String getConfiguredProtocols() {
|
||||
|
@ -651,7 +651,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport {
|
|||
message.acknowledge();
|
||||
done.countDown();
|
||||
} catch (JMSException ex) {
|
||||
LOG.debug("Caught exception.", ex);
|
||||
logger.debug("Caught exception.", ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -731,7 +731,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport {
|
|||
while (count > 0) {
|
||||
try {
|
||||
if (++n % 1000 == 0) {
|
||||
LOG.debug("received {} messages", n);
|
||||
logger.debug("received {} messages", n);
|
||||
}
|
||||
|
||||
Message m = consumer.receive(5000);
|
||||
|
@ -783,11 +783,11 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport {
|
|||
Wait.assertEquals(0, queueView::getMessageCount);
|
||||
|
||||
long taken = (System.currentTimeMillis() - time);
|
||||
LOG.debug("Microbenchamrk ran in {} milliseconds, sending/receiving {}", taken, numMessages);
|
||||
logger.debug("Microbenchamrk ran in {} milliseconds, sending/receiving {}", taken, numMessages);
|
||||
|
||||
double messagesPerSecond = ((double) numMessages / (double) taken) * 1000;
|
||||
|
||||
LOG.debug("{} messages per second", ((int) messagesPerSecond));
|
||||
logger.debug("{} messages per second", ((int) messagesPerSecond));
|
||||
}
|
||||
|
||||
@Test(timeout = 60000)
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class JMSMessageGroupsTest extends JMSClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int ITERATIONS = 10;
|
||||
private static final int MESSAGE_COUNT = 10;
|
||||
|
@ -279,11 +279,11 @@ public class JMSMessageGroupsTest extends JMSClientTestSupport {
|
|||
for (int i = 0; i < MESSAGE_COUNT; ++i) {
|
||||
Message message = consumer.receive(RECEIVE_TIMEOUT);
|
||||
assertNotNull(message);
|
||||
LOG.debug("Read message #{}: type = {}", i, message.getClass().getSimpleName());
|
||||
logger.debug("Read message #{}: type = {}", i, message.getClass().getSimpleName());
|
||||
String gid = message.getStringProperty("JMSXGroupID");
|
||||
int seq = message.getIntProperty("JMSXGroupSeq");
|
||||
LOG.debug("Message assigned JMSXGroupID := {}", gid);
|
||||
LOG.debug("Message assigned JMSXGroupSeq := {}", seq);
|
||||
logger.debug("Message assigned JMSXGroupID := {}", gid);
|
||||
logger.debug("Message assigned JMSXGroupSeq := {}", seq);
|
||||
assertEquals("Sequence order should match", sequence.incrementAndGet(), seq);
|
||||
if (additionalCheck != null) {
|
||||
additionalCheck.accept(i, message);
|
||||
|
@ -308,7 +308,7 @@ public class JMSMessageGroupsTest extends JMSClientTestSupport {
|
|||
buffer[count] = (byte) value;
|
||||
}
|
||||
|
||||
LOG.debug("Sending {} messages to destination: {}", MESSAGE_COUNT, queue);
|
||||
logger.debug("Sending {} messages to destination: {}", MESSAGE_COUNT, queue);
|
||||
for (int i = 1; i <= MESSAGE_COUNT; i++) {
|
||||
BytesMessage message = session.createBytesMessage();
|
||||
message.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test(timeout = 60000)
|
||||
public void testBrowseAllInQueueZeroPrefetch() throws Exception {
|
||||
|
@ -68,11 +68,11 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (count < MSG_COUNT && enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
}
|
||||
|
||||
LOG.debug("Received all expected message, checking that hasMoreElements returns false");
|
||||
logger.debug("Received all expected message, checking that hasMoreElements returns false");
|
||||
assertFalse(enumeration.hasMoreElements());
|
||||
assertEquals(5, count);
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message m = (Message) enumeration.nextElement();
|
||||
assertTrue(m instanceof TextMessage);
|
||||
LOG.debug("Browsed message {} from Queue {}", m, queue);
|
||||
logger.debug("Browsed message {} from Queue {}", m, queue);
|
||||
}
|
||||
|
||||
browser.close();
|
||||
|
@ -161,7 +161,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
TimeUnit.MILLISECONDS.sleep(50);
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
}
|
||||
assertFalse(enumeration.hasMoreElements());
|
||||
|
@ -216,7 +216,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
}
|
||||
assertFalse(enumeration.hasMoreElements());
|
||||
|
@ -251,7 +251,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ public class JMSQueueBrowserTest extends JMSClientTestSupport {
|
|||
while (enumeration.hasMoreElements()) {
|
||||
Message msg = (Message) enumeration.nextElement();
|
||||
assertNotNull(msg);
|
||||
LOG.debug("Recv: {}", msg);
|
||||
logger.debug("Recv: {}", msg);
|
||||
count++;
|
||||
}
|
||||
assertFalse(enumeration.hasMoreElements());
|
||||
|
|
|
@ -78,7 +78,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class JMSSaslGssapiTest extends JMSClientTestSupport {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static {
|
||||
String path = System.getProperty("java.security.auth.login.config");
|
||||
|
@ -117,15 +117,15 @@ public class JMSSaslGssapiTest extends JMSClientTestSupport {
|
|||
rewriteKrbConfFile(kdc);
|
||||
|
||||
if (debug) {
|
||||
LOG.debug("java.security.krb5.conf='{}'", System.getProperty("java.security.krb5.conf"));
|
||||
logger.debug("java.security.krb5.conf='{}'", System.getProperty("java.security.krb5.conf"));
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(System.getProperty("java.security.krb5.conf")))) {
|
||||
br.lines().forEach(line -> LOG.debug(line));
|
||||
br.lines().forEach(line -> logger.debug(line));
|
||||
}
|
||||
|
||||
Keytab kt = Keytab.loadKeytab(userKeyTab);
|
||||
for (PrincipalName name : kt.getPrincipals()) {
|
||||
for (KeytabEntry entry : kt.getKeytabEntries(name)) {
|
||||
LOG.info("KeyTab Entry: PrincipalName:{} ; KeyInfo:{}", entry.getPrincipal(), entry.getKey().getKeyType());
|
||||
logger.info("KeyTab Entry: PrincipalName:{} ; KeyInfo:{}", entry.getPrincipal(), entry.getKey().getKeyType());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ import static org.apache.activemq.artemis.tests.util.ActiveMQTestBase.NETTY_ACCE
|
|||
@CreateKdcServer(transports = {@CreateTransport(protocol = "TCP", port = 0)})
|
||||
@ApplyLdifFiles("SaslKrb5LDAPSecurityTest.ldif")
|
||||
public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit {
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String QUEUE_NAME = "some_queue";
|
||||
|
||||
|
@ -219,11 +219,11 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
Method refreshMethod = classRef.getMethod("refresh", new Class[0]);
|
||||
refreshMethod.invoke(classRef, new Object[0]);
|
||||
|
||||
LOG.debug("krb5.conf to: {}", krb5conf.getAbsolutePath());
|
||||
logger.debug("krb5.conf to: {}", krb5conf.getAbsolutePath());
|
||||
if (debug) {
|
||||
LOG.debug("java.security.krb5.conf='{}'", System.getProperty("java.security.krb5.conf"));
|
||||
logger.debug("java.security.krb5.conf='{}'", System.getProperty("java.security.krb5.conf"));
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(System.getProperty("java.security.krb5.conf")))) {
|
||||
br.lines().forEach(line -> LOG.debug(line));
|
||||
br.lines().forEach(line -> logger.debug(line));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
String ss = LdifUtils.convertToLdif(entry);
|
||||
st += ss + "\n";
|
||||
}
|
||||
LOG.debug(st);
|
||||
logger.debug(st);
|
||||
|
||||
cursor = (EntryFilteringCursor) getService().getAdminSession().search(new Dn("dc=example,dc=com"), SearchScope.SUBTREE, new PresenceNode("ObjectClass"), AliasDerefMode.DEREF_ALWAYS);
|
||||
st = "";
|
||||
|
@ -247,7 +247,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
String ss = LdifUtils.convertToLdif(entry);
|
||||
st += ss + "\n";
|
||||
}
|
||||
LOG.debug(st);
|
||||
logger.debug(st);
|
||||
}
|
||||
|
||||
private void initLogging() {
|
||||
|
|
|
@ -44,7 +44,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ActiveMQCrashTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public ActiveMQServer server;
|
||||
|
||||
|
@ -100,11 +100,11 @@ public class ActiveMQCrashTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
|
||||
log.debug("AckInterceptor.intercept {}", packet);
|
||||
logger.debug("AckInterceptor.intercept {}", packet);
|
||||
|
||||
if (packet.getType() == PacketImpl.SESS_SEND) {
|
||||
try {
|
||||
log.debug("Stopping server");
|
||||
logger.debug("Stopping server");
|
||||
|
||||
new Thread() {
|
||||
@Override
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class ConsumerRoundRobinTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public final SimpleString addressA = new SimpleString("addressA");
|
||||
|
||||
|
@ -69,9 +69,9 @@ public class ConsumerRoundRobinTest extends ActiveMQTestBase {
|
|||
}
|
||||
int currMessage = 0;
|
||||
for (int i = 0; i < numMessage / 5; i++) {
|
||||
log.debug("i is {}", i);
|
||||
logger.debug("i is {}", i);
|
||||
for (int j = 0; j < 5; j++) {
|
||||
log.debug("j is {}", j);
|
||||
logger.debug("j is {}", j);
|
||||
ClientMessage cm = consumers[j].receive(5000);
|
||||
Assert.assertNotNull(cm);
|
||||
Assert.assertEquals(currMessage++, cm.getBodyBuffer().readInt());
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class FailureDeadlockTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server;
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class FailureDeadlockTest extends ActiveMQTestBase {
|
|||
try {
|
||||
conn2.close();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to close connection2", e);
|
||||
logger.error("Failed to close connection2", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private Topic topic;
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
Connection connection = null;
|
||||
Session session = null;
|
||||
MessageProducer prod;
|
||||
log.debug("Starting producer for {} - {}", topic, getName());
|
||||
logger.debug("Starting producer for {} - {}", topic, getName());
|
||||
try {
|
||||
connection = cf.createConnection();
|
||||
session = connection.createSession(true, Session.SESSION_TRANSACTED);
|
||||
|
@ -129,10 +129,10 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
session.commit();
|
||||
}
|
||||
if (i % 100 == 0) {
|
||||
log.debug("Address {} sent {} messages", topic, i);
|
||||
logger.debug("Address {} sent {} messages", topic, i);
|
||||
}
|
||||
}
|
||||
log.debug("Ending producer for {} - {} messages {}", topic, getName(), sentMessages);
|
||||
logger.debug("Ending producer for {} - {} messages {}", topic, getName(), sentMessages);
|
||||
} catch (Exception e) {
|
||||
error = true;
|
||||
e.printStackTrace();
|
||||
|
@ -206,7 +206,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
Session session = null;
|
||||
stopped = false;
|
||||
requestForStop = false;
|
||||
log.debug("Starting consumer for {} - {}", topic, getName());
|
||||
logger.debug("Starting consumer for {} - {}", topic, getName());
|
||||
try {
|
||||
connection = cf.createConnection();
|
||||
|
||||
|
@ -224,11 +224,11 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
|
||||
while (counter < numberOfMessages && !requestForStop && !error) {
|
||||
if (counter == 0) {
|
||||
log.debug("Starting to consume for {} - {}", topic, getName());
|
||||
logger.debug("Starting to consume for {} - {}", topic, getName());
|
||||
}
|
||||
BytesMessage msg = (BytesMessage) subscriber.receive(receiveTimeout);
|
||||
if (msg == null) {
|
||||
log.debug("Cannot get message in specified timeout: {} - {}", topic, getName());
|
||||
logger.debug("Cannot get message in specified timeout: {} - {}", topic, getName());
|
||||
error = true;
|
||||
} else {
|
||||
counter++;
|
||||
|
@ -240,13 +240,13 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
session.commit();
|
||||
}
|
||||
if (counter % 100 == 0) {
|
||||
log.debug("## {} {} received {}", getName(), topic, counter);
|
||||
logger.debug("## {} {} received {}", getName(), topic, counter);
|
||||
}
|
||||
receivedMessages = counter;
|
||||
}
|
||||
session.commit();
|
||||
} catch (Exception e) {
|
||||
log.debug("Exception in consumer {} : {}", getName(), e.getMessage());
|
||||
logger.debug("Exception in consumer {} : {}", getName(), e.getMessage());
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (session != null) {
|
||||
|
@ -265,7 +265,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
}
|
||||
}
|
||||
stopped = true;
|
||||
log.debug("Stopping consumer for {} - {}, received {}", topic, getName(), getReceivedMessages());
|
||||
logger.debug("Stopping consumer for {} - {}, received {}", topic, getName(), getReceivedMessages());
|
||||
}
|
||||
|
||||
public int getReceivedMessages() {
|
||||
|
@ -319,7 +319,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
|
|||
Assert.fail(errorMessage);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
|
|||
|
||||
public class IncompatibleVersionTest extends SpawnedTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String WORD_START = "&*STARTED&*";
|
||||
|
||||
|
@ -230,7 +230,7 @@ public class IncompatibleVersionTest extends SpawnedTestBase {
|
|||
|
||||
System.out.println(WORD_START);
|
||||
|
||||
log.debug("### server: {}", startedString);
|
||||
logger.debug("### server: {}", startedString);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ public class IncompatibleVersionTest extends SpawnedTestBase {
|
|||
locator = createNettyNonHALocator();
|
||||
sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(false, true, true);
|
||||
log.debug("### client: connected. server incrementingVersion = {}", session.getVersion());
|
||||
logger.debug("### client: connected. server incrementingVersion = {}", session.getVersion());
|
||||
session.close();
|
||||
} finally {
|
||||
closeSessionFactory(sf);
|
||||
|
|
|
@ -76,7 +76,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static final int RECEIVE_WAIT_TIME = 60000;
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
log.debug("Receiving message");
|
||||
logger.debug("Receiving message");
|
||||
ClientMessage msg = cons.receive(5000);
|
||||
if (msg == null) {
|
||||
System.err.println("Message not received");
|
||||
|
@ -235,7 +235,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
log.debug("Receiving message");
|
||||
logger.debug("Receiving message");
|
||||
javax.jms.Message msg = consumer.receive(5000);
|
||||
if (msg == null) {
|
||||
System.err.println("Message not received");
|
||||
|
@ -243,10 +243,10 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
return;
|
||||
}
|
||||
} catch (JMSException e) {
|
||||
log.debug("This exception was ok as it was expected", e);
|
||||
logger.debug("This exception was ok as it was expected", e);
|
||||
expectedErrors.incrementAndGet();
|
||||
} catch (Throwable e) {
|
||||
log.warn("Captured unexpected exception", e);
|
||||
logger.warn("Captured unexpected exception", e);
|
||||
unexpectedErrors.incrementAndGet();
|
||||
}
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
server.start();
|
||||
|
||||
for (int start = 0; start < 2; start++) {
|
||||
log.debug("Start {}", start);
|
||||
logger.debug("Start {}", start);
|
||||
|
||||
sf = createSessionFactory(locator);
|
||||
|
||||
|
@ -466,7 +466,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
ClientConsumer cons1 = session.createConsumer(ADDRESS);
|
||||
session.start();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
log.info("I = {}", i);
|
||||
logger.info("I = {}", i);
|
||||
ClientMessage msg = cons1.receive(5000);
|
||||
Assert.assertNotNull(msg);
|
||||
Assert.assertEquals(1, msg.getIntProperty("txid").intValue());
|
||||
|
@ -531,7 +531,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
|
||||
@Override
|
||||
public void postAcknowledge(final MessageReference ref, AckReason reason) {
|
||||
log.debug("Ignoring postACK on message {}", ref);
|
||||
logger.debug("Ignoring postACK on message {}", ref);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -745,7 +745,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase {
|
|||
if (packet instanceof SessionContinuationMessage) {
|
||||
SessionContinuationMessage msg = (SessionContinuationMessage) packet;
|
||||
if (!msg.isContinues() && intMessages) {
|
||||
log.debug("Ignored a message");
|
||||
logger.debug("Ignored a message");
|
||||
latch.countDown();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class LargeMessageTest extends LargeMessageTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int RECEIVE_WAIT_TIME = 10000;
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
@Test
|
||||
public void testRollbackPartiallyConsumedBuffer() throws Exception {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
log.debug("#test {}", i);
|
||||
logger.debug("#test {}", i);
|
||||
internalTestRollbackPartiallyConsumedBuffer(false);
|
||||
tearDown();
|
||||
setUp();
|
||||
|
@ -670,7 +670,7 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
msg.acknowledge();
|
||||
Assert.assertEquals(1, msg.getDeliveryCount());
|
||||
|
||||
log.debug("body buffer is {}", msg.getBodyBuffer());
|
||||
logger.debug("body buffer is {}", msg.getBodyBuffer());
|
||||
|
||||
for (int i = 0; i < messageSize; i++) {
|
||||
Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte());
|
||||
|
@ -1574,7 +1574,7 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
msg.acknowledge();
|
||||
consumer.close();
|
||||
|
||||
log.debug("Stopping");
|
||||
logger.debug("Stopping");
|
||||
|
||||
session.stop();
|
||||
|
||||
|
@ -2243,12 +2243,12 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
log.debug("Sending");
|
||||
logger.debug("Sending");
|
||||
producer.send(clientFile);
|
||||
|
||||
producer.close();
|
||||
|
||||
log.debug("Waiting");
|
||||
logger.debug("Waiting");
|
||||
|
||||
ClientConsumer consumer = session.createConsumer(ADDRESS);
|
||||
|
||||
|
@ -2311,12 +2311,12 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
log.debug("Sending");
|
||||
logger.debug("Sending");
|
||||
producer.send(clientFile);
|
||||
|
||||
producer.close();
|
||||
|
||||
log.debug("Waiting");
|
||||
logger.debug("Waiting");
|
||||
|
||||
ClientConsumer consumer = session.createConsumer(ADDRESS);
|
||||
|
||||
|
@ -2455,16 +2455,16 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
msg.putIntProperty(new SimpleString("key"), i);
|
||||
producer.send(msg);
|
||||
|
||||
log.debug("Sent msg {}", i);
|
||||
logger.debug("Sent msg {}", i);
|
||||
}
|
||||
|
||||
session.start();
|
||||
|
||||
log.debug("Sending");
|
||||
logger.debug("Sending");
|
||||
|
||||
producer.close();
|
||||
|
||||
log.debug("Waiting");
|
||||
logger.debug("Waiting");
|
||||
|
||||
ClientConsumer consumer = session.createConsumer(ADDRESS);
|
||||
|
||||
|
@ -2484,7 +2484,7 @@ public class LargeMessageTest extends LargeMessageTestBase {
|
|||
Assert.assertEquals(0, ((Queue) server.getPostOffice().getBinding(ADDRESS).getBindable()).getDeliveringCount());
|
||||
Assert.assertEquals(0, getMessageCount(((Queue) server.getPostOffice().getBinding(ADDRESS).getBindable())));
|
||||
|
||||
log.debug("Thread done");
|
||||
logger.debug("Thread done");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class MessageConcurrencyTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server;
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class MessageConcurrencyTest extends ActiveMQTestBase {
|
|||
producer.send(msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to send message", e);
|
||||
logger.error("Failed to send message", e);
|
||||
|
||||
failed = true;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class MessageGroupingTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server;
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class MessageGroupingTest extends ActiveMQTestBase {
|
|||
Assert.assertEquals(cm.getBodyBuffer().readString(), "m" + i);
|
||||
}
|
||||
|
||||
log.debug("closing consumer2");
|
||||
logger.debug("closing consumer2");
|
||||
|
||||
consumer2.close();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class MessagePriorityTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server;
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class MessagePriorityTest extends ActiveMQTestBase {
|
|||
for (int i = 9; i >= 0; i--) {
|
||||
ClientMessage m = consumer.receive(500);
|
||||
|
||||
log.debug("received msg {}", m.getPriority());
|
||||
logger.debug("received msg {}", m.getPriority());
|
||||
|
||||
Assert.assertNotNull(m);
|
||||
Assert.assertEquals(i, m.getPriority());
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class NIOvsOIOTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testNIOPerf() throws Exception {
|
||||
|
@ -198,7 +198,7 @@ public class NIOvsOIOTest extends ActiveMQTestBase {
|
|||
try {
|
||||
producer.send(msg);
|
||||
} catch (Exception e) {
|
||||
log.error("Caught exception", e);
|
||||
logger.error("Caught exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ public class NIOvsOIOTest extends ActiveMQTestBase {
|
|||
try {
|
||||
msg.acknowledge();
|
||||
} catch (Exception e) {
|
||||
log.error("Caught exception", e);
|
||||
logger.error("Caught exception", e);
|
||||
}
|
||||
|
||||
count++;
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class SessionStopStartTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server;
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class SessionStopStartTest extends ActiveMQTestBase {
|
|||
try {
|
||||
session.stop();
|
||||
} catch (Exception e) {
|
||||
SessionStopStartTest.log.warn(e.getMessage(), e);
|
||||
SessionStopStartTest.logger.warn(e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class TemporaryQueueTest extends SingleServerTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final long CONNECTION_TTL = 2000;
|
||||
|
||||
|
@ -372,11 +372,11 @@ public class TemporaryQueueTest extends SingleServerTestBase {
|
|||
latch.countDown();
|
||||
|
||||
if (!message.getStringProperty("color").equals(color)) {
|
||||
log.warn("Unexpected color {} when we were expecting {}", message.getStringProperty("color"), color);
|
||||
logger.warn("Unexpected color {} when we were expecting {}", message.getStringProperty("color"), color);
|
||||
errors.incrementAndGet();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
errors.incrementAndGet();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class ClientCrashTest extends ClientTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Rule
|
||||
public SpawnedVMCheck spawnedVMCheck = new SpawnedVMCheck();
|
||||
|
@ -148,7 +148,7 @@ public class ClientCrashTest extends ClientTestBase {
|
|||
// spawn a JVM that creates a Core client, which sends a message
|
||||
p = SpawnedVMSupport.spawnVM(CrashClient2.class.getName());
|
||||
|
||||
ClientCrashTest.log.debug("waiting for the client VM to crash ...");
|
||||
ClientCrashTest.logger.debug("waiting for the client VM to crash ...");
|
||||
Assert.assertTrue(p.waitFor(1, TimeUnit.MINUTES));
|
||||
|
||||
assertEquals(CrashClient2.OK, p.exitValue());
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ClientExitTest extends ClientTestBase {
|
|||
|
||||
private static final SimpleString QUEUE = new SimpleString("ClientExitTestQueue");
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ClientSession session;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class ClientExitTest extends ClientTestBase {
|
|||
|
||||
// the client VM should exit by itself. If it doesn't, that means we have a problem
|
||||
// and the test will timeout
|
||||
ClientExitTest.log.debug("waiting for the client VM to exit ...");
|
||||
ClientExitTest.logger.debug("waiting for the client VM to exit ...");
|
||||
p.waitFor();
|
||||
|
||||
assertEquals(0, p.exitValue());
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class CrashClient {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static int OK = 9;
|
||||
public static int NOT_OK = 1;
|
||||
|
@ -59,7 +59,7 @@ public class CrashClient {
|
|||
// exit without closing the session properly
|
||||
System.exit(OK);
|
||||
} catch (Throwable t) {
|
||||
CrashClient.log.error(t.getMessage(), t);
|
||||
CrashClient.logger.error(t.getMessage(), t);
|
||||
System.exit(NOT_OK);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class CrashClient2 {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
public static final int OK = 9;
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
|
@ -62,7 +62,7 @@ public class CrashClient2 {
|
|||
ClientMessage msg = cons.receive(10000);
|
||||
|
||||
if (msg == null) {
|
||||
log.error("Didn't receive msg");
|
||||
logger.error("Didn't receive msg");
|
||||
|
||||
System.exit(1);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class CrashClient2 {
|
|||
// exit without closing the session properly
|
||||
System.exit(OK);
|
||||
} catch (Throwable t) {
|
||||
log.error(t.getMessage(), t);
|
||||
logger.error(t.getMessage(), t);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class DummyInterceptor implements Interceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
boolean sendException = false;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class DummyInterceptor implements Interceptor {
|
|||
|
||||
@Override
|
||||
public boolean intercept(final Packet packet, final RemotingConnection conn) throws ActiveMQException {
|
||||
log.debug("DummyFilter packet = {}", packet.getClass().getName());
|
||||
logger.debug("DummyFilter packet = {}", packet.getClass().getName());
|
||||
syncCounter.addAndGet(1);
|
||||
if (sendException) {
|
||||
throw new ActiveMQInternalErrorException();
|
||||
|
@ -57,7 +57,7 @@ public class DummyInterceptor implements Interceptor {
|
|||
if (changeMessage) {
|
||||
if (packet instanceof SessionReceiveMessage) {
|
||||
SessionReceiveMessage deliver = (SessionReceiveMessage) packet;
|
||||
log.debug("msg = {}", deliver.getMessage().getClass().getName());
|
||||
logger.debug("msg = {}", deliver.getMessage().getClass().getName());
|
||||
deliver.getMessage().putStringProperty(new SimpleString("DummyInterceptor"), new SimpleString("was here"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class DummyInterceptorB implements Interceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static AtomicInteger syncCounter = new AtomicInteger(0);
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class DummyInterceptorB implements Interceptor {
|
|||
@Override
|
||||
public boolean intercept(final Packet packet, final RemotingConnection conn) throws ActiveMQException {
|
||||
DummyInterceptorB.syncCounter.addAndGet(1);
|
||||
log.debug("DummyFilter packet = {}", packet);
|
||||
logger.debug("DummyFilter packet = {}", packet);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.lang.invoke.MethodHandles;
|
|||
* Code to be run in an external VM, via main()
|
||||
*/
|
||||
public class GracefulClient {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
|
@ -64,7 +64,7 @@ public class GracefulClient {
|
|||
session.close();
|
||||
System.exit(0);
|
||||
} catch (Throwable t) {
|
||||
GracefulClient.log.error(t.getMessage(), t);
|
||||
GracefulClient.logger.error(t.getMessage(), t);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
@Parameterized.Parameter(0)
|
||||
public boolean persistCache;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int NUM_MESSAGES = 100;
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
|
||||
startServers();
|
||||
|
||||
BridgeReconnectTest.log.debug("** failing connection");
|
||||
BridgeReconnectTest.logger.debug("** failing connection");
|
||||
// Now we will simulate a failure of the bridge connection between server0 and server1
|
||||
server0.fail(true);
|
||||
|
||||
|
@ -507,7 +507,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
// Simulate CPU load until bridge delivery after failure
|
||||
deliveryAfterFailureLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
log.debug("Interrupted", e);
|
||||
logger.debug("Interrupted", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,9 +519,9 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
// before routing messages delivered by bridge before failure
|
||||
routingBarrier.await();
|
||||
} catch (InterruptedException e) {
|
||||
log.debug("Interrupted", e);
|
||||
logger.debug("Interrupted", e);
|
||||
} catch (BrokenBarrierException e) {
|
||||
log.debug("Interrupted", e);
|
||||
logger.debug("Interrupted", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -611,16 +611,16 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
|
||||
ClientProducer prod0 = session0.createProducer(testAddress);
|
||||
|
||||
BridgeReconnectTest.log.debug("stopping server1");
|
||||
BridgeReconnectTest.logger.debug("stopping server1");
|
||||
server1.stop();
|
||||
|
||||
if (sleep) {
|
||||
Thread.sleep(2 * clientFailureCheckPeriod);
|
||||
}
|
||||
|
||||
BridgeReconnectTest.log.debug("restarting server1");
|
||||
BridgeReconnectTest.logger.debug("restarting server1");
|
||||
server1.start();
|
||||
BridgeReconnectTest.log.debug("server 1 restarted");
|
||||
BridgeReconnectTest.logger.debug("server 1 restarted");
|
||||
|
||||
ClientSessionFactory csf1 = locator.createSessionFactory(server1tc);
|
||||
session1 = csf1.createSession(false, true, true);
|
||||
|
@ -640,7 +640,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
prod0.send(message);
|
||||
}
|
||||
|
||||
BridgeReconnectTest.log.debug("sent messages");
|
||||
BridgeReconnectTest.logger.debug("sent messages");
|
||||
|
||||
for (int i = 0; i < numMessages; i++) {
|
||||
ClientMessage r1 = cons1.receive(30000);
|
||||
|
@ -648,7 +648,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
assertEquals("property value matches", i, r1.getObjectProperty(propKey));
|
||||
}
|
||||
|
||||
BridgeReconnectTest.log.debug("got messages");
|
||||
BridgeReconnectTest.logger.debug("got messages");
|
||||
closeServers();
|
||||
assertNoMoreConnections();
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
|
|||
fail("Message " + outOfOrder + " was received out of order, it was supposed to be " + supposed);
|
||||
}
|
||||
|
||||
log.debug("=========== second failure, sending message");
|
||||
logger.debug("=========== second failure, sending message");
|
||||
|
||||
// Fail again - should reconnect
|
||||
forwardingConnection = ((BridgeImpl) bridge).getForwardingConnection();
|
||||
|
|
|
@ -95,7 +95,7 @@ import java.lang.invoke.MethodHandles;
|
|||
@RunWith(value = Parameterized.class)
|
||||
public class BridgeTest extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ActiveMQServer server0;
|
||||
private ActiveMQServer server1;
|
||||
|
@ -1497,7 +1497,7 @@ public class BridgeTest extends ActiveMQTestBase {
|
|||
msgCount.incrementAndGet();
|
||||
|
||||
if (i % 500 == 0)
|
||||
log.debug("received {}", i);
|
||||
logger.debug("received {}", i);
|
||||
}
|
||||
|
||||
boolean failed = false;
|
||||
|
@ -1815,7 +1815,7 @@ public class BridgeTest extends ActiveMQTestBase {
|
|||
|
||||
File outputFile = new File(getTemporaryDir(), "huge_message_received.dat");
|
||||
|
||||
log.debug("-----message save to: {}", outputFile.getAbsolutePath());
|
||||
logger.debug("-----message save to: {}", outputFile.getAbsolutePath());
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
|
||||
|
||||
BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
|
||||
|
@ -1860,7 +1860,7 @@ public class BridgeTest extends ActiveMQTestBase {
|
|||
|
||||
createFile(fileInput, largeMessageSize);
|
||||
|
||||
log.debug("File created at: {}", fileInput.getAbsolutePath());
|
||||
logger.debug("File created at: {}", fileInput.getAbsolutePath());
|
||||
|
||||
ClientMessage message = session.createMessage(Message.BYTES_TYPE, true);
|
||||
|
||||
|
@ -1874,13 +1874,13 @@ public class BridgeTest extends ActiveMQTestBase {
|
|||
|
||||
private static void createFile(final File file, final long fileSize) throws IOException {
|
||||
if (file.exists()) {
|
||||
log.warn("---file already there {}", file.length());
|
||||
logger.warn("---file already there {}", file.length());
|
||||
return;
|
||||
}
|
||||
FileOutputStream fileOut = new FileOutputStream(file);
|
||||
BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);
|
||||
byte[] outBuffer = new byte[1024 * 1024];
|
||||
log.debug(" --- creating file, size: {}", fileSize);
|
||||
logger.debug(" --- creating file, size: {}", fileSize);
|
||||
for (long i = 0; i < fileSize; i += outBuffer.length) {
|
||||
buffOut.write(outBuffer);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
public class AutoDeleteDistributedTest extends ClusterTestBase {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@Before
|
||||
|
@ -111,7 +111,7 @@ public class AutoDeleteDistributedTest extends ClusterTestBase {
|
|||
client2JmsConsumer.setMessageListener(new MessageListener() {
|
||||
@Override
|
||||
public void onMessage(final javax.jms.Message m) {
|
||||
log.debug("Message received. {}", m);
|
||||
logger.debug("Message received. {}", m);
|
||||
onMessageReceived.countDown();
|
||||
}
|
||||
});
|
||||
|
@ -126,7 +126,7 @@ public class AutoDeleteDistributedTest extends ClusterTestBase {
|
|||
jmsProducer.setAsync(new javax.jms.CompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(final javax.jms.Message m) {
|
||||
log.debug("Message sent. {}", m);
|
||||
logger.debug("Message sent. {}", m);
|
||||
onMessageSent.countDown();
|
||||
}
|
||||
|
||||
|
@ -142,11 +142,11 @@ public class AutoDeleteDistributedTest extends ClusterTestBase {
|
|||
jmsProducer.send(client1JmsContext.createQueue("queues.myQueue"), jmsMsg);
|
||||
}
|
||||
|
||||
log.debug("Waiting for message to be sent...");
|
||||
logger.debug("Waiting for message to be sent...");
|
||||
onMessageSent.await(5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
log.debug("Waiting for message to be received...");
|
||||
logger.debug("Waiting for message to be received...");
|
||||
Assert.assertTrue(onMessageReceived.await(5, TimeUnit.SECONDS));
|
||||
|
||||
client2JmsConsumer.close();
|
||||
|
|
|
@ -102,7 +102,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public abstract class ClusterTestBase extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int[] PORTS = {TransportConstants.DEFAULT_PORT, TransportConstants.DEFAULT_PORT + 1, TransportConstants.DEFAULT_PORT + 2, TransportConstants.DEFAULT_PORT + 3, TransportConstants.DEFAULT_PORT + 4, TransportConstants.DEFAULT_PORT + 5, TransportConstants.DEFAULT_PORT + 6, TransportConstants.DEFAULT_PORT + 7, TransportConstants.DEFAULT_PORT + 8, TransportConstants.DEFAULT_PORT + 9,};
|
||||
|
||||
|
@ -150,7 +150,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
try {
|
||||
pluggableQuorumConfiguration = new DistributedPrimitiveManagerConfiguration(FileBasedPrimitiveManager.class.getName(), Collections.singletonMap("locks-folder", temporaryFolder.newFolder("manager").toString()));
|
||||
} catch (IOException ioException) {
|
||||
log.error(ioException.getMessage(), ioException);
|
||||
logger.error(ioException.getMessage(), ioException);
|
||||
return null;
|
||||
}
|
||||
return pluggableQuorumConfiguration;
|
||||
|
@ -281,8 +281,8 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
protected void waitForFailoverTopology(final int bNode, final int... nodes) throws Exception {
|
||||
ActiveMQServer server = servers[bNode];
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("waiting for {} on the topology for server = {}", Arrays.toString(nodes), server);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("waiting for {} on the topology for server = {}", Arrays.toString(nodes), server);
|
||||
}
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
@ -327,7 +327,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
topology +
|
||||
")";
|
||||
|
||||
log.error(msg);
|
||||
logger.error(msg);
|
||||
|
||||
logTopologyDiagram();
|
||||
|
||||
|
@ -337,7 +337,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
}
|
||||
|
||||
private void logTopologyDiagram() {
|
||||
if (!log.isDebugEnabled()) {
|
||||
if (!logger.isDebugEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -387,9 +387,9 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
}
|
||||
}
|
||||
topologyDiagram.append("\n");
|
||||
log.debug(topologyDiagram.toString());
|
||||
logger.debug(topologyDiagram.toString());
|
||||
} catch (Throwable e) {
|
||||
log.warn(String.format("error printing the topology::%s", e.getMessage()), e);
|
||||
logger.warn(String.format("error printing the topology::%s", e.getMessage()), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
if (!servers[node].waitForActivation(waitTimeout, TimeUnit.MILLISECONDS)) {
|
||||
String msg = "Timed out waiting for server starting = " + node;
|
||||
|
||||
log.error(msg);
|
||||
logger.error(msg);
|
||||
|
||||
throw new IllegalStateException(msg);
|
||||
}
|
||||
|
@ -443,8 +443,8 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
final int expectedBindingCount,
|
||||
final int expectedConsumerCount,
|
||||
final boolean local) throws Exception {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("waiting for bindings on node {} address {} expectedBindingCount {} consumerCount {} local {}",
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("waiting for bindings on node {} address {} expectedBindingCount {} consumerCount {} local {}",
|
||||
node, address, expectedBindingCount, expectedConsumerCount, local);
|
||||
}
|
||||
|
||||
|
@ -463,14 +463,14 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
PostOffice po = server.getPostOffice();
|
||||
Bindings bindings = po.getBindingsForAddress(new SimpleString(address));
|
||||
|
||||
log.debug("=======================================================================");
|
||||
log.debug("Binding information for address = {} on node {}", address, node);
|
||||
logger.debug("=======================================================================");
|
||||
logger.debug("Binding information for address = {} on node {}", address, node);
|
||||
|
||||
for (Binding binding : bindings.getBindings()) {
|
||||
if (binding.isConnected() && (binding instanceof LocalQueueBinding && local || binding instanceof RemoteQueueBinding && !local)) {
|
||||
QueueBinding qBinding = (QueueBinding) binding;
|
||||
|
||||
log.debug("Binding = {}, queue={}", qBinding, qBinding.getQueue());
|
||||
logger.debug("Binding = {}, queue={}", qBinding, qBinding.getQueue());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
filterString = ClusterTestBase.FILTER_PROP.toString() + "='" + filterVal + "'";
|
||||
}
|
||||
|
||||
log.debug("Creating {} , address {} on {}", queueName, address, servers[node]);
|
||||
logger.debug("Creating {} , address {} on {}", queueName, address, servers[node]);
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filterString).setDurable(durable));
|
||||
|
||||
|
@ -916,7 +916,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
ClientMessage message = holder.consumer.receive(2000);
|
||||
|
||||
if (message == null) {
|
||||
log.debug("*** dumping consumers:");
|
||||
logger.debug("*** dumping consumers:");
|
||||
|
||||
dumpConsumers();
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
ClientMessage message = holder.consumer.receive(WAIT_TIMEOUT);
|
||||
|
||||
if (message == null) {
|
||||
log.debug("*** dumping consumers:");
|
||||
logger.debug("*** dumping consumers:");
|
||||
|
||||
dumpConsumers();
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
message.getObjectProperty(ClusterTestBase.COUNT_PROP);
|
||||
}
|
||||
outOfOrder = true;
|
||||
log.debug("Message j={} was received out of order = {}", j, message.getObjectProperty(ClusterTestBase.COUNT_PROP));
|
||||
logger.debug("Message j={} was received out of order = {}", j, message.getObjectProperty(ClusterTestBase.COUNT_PROP));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1037,7 +1037,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
private void dumpConsumers() throws Exception {
|
||||
for (int i = 0; i < consumers.length; i++) {
|
||||
if (consumers[i] != null && !consumers[i].consumer.isClosed()) {
|
||||
log.debug("Dumping consumer {}", i);
|
||||
logger.debug("Dumping consumer {}", i);
|
||||
|
||||
checkReceive(i);
|
||||
}
|
||||
|
@ -1090,9 +1090,9 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
message = holder.consumer.receive(500);
|
||||
|
||||
if (message != null) {
|
||||
log.debug("check receive Consumer {} received message {}", consumerID, message.getObjectProperty(ClusterTestBase.COUNT_PROP));
|
||||
logger.debug("check receive Consumer {} received message {}", consumerID, message.getObjectProperty(ClusterTestBase.COUNT_PROP));
|
||||
} else {
|
||||
log.debug("check receive Consumer {} null message", consumerID);
|
||||
logger.debug("check receive Consumer {} null message", consumerID);
|
||||
}
|
||||
}
|
||||
while (message != null);
|
||||
|
@ -1262,7 +1262,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
|
||||
checkMessageBody(message);
|
||||
|
||||
// log.debug("consumer {} received message {}", consumerIDs[i], count);
|
||||
// logger.debug("consumer {} received message {}", consumerIDs[i], count);
|
||||
|
||||
Assert.assertFalse(counts.contains(count));
|
||||
|
||||
|
@ -1992,7 +1992,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
|
||||
protected void startServers(final int... nodes) throws Exception {
|
||||
for (int node : nodes) {
|
||||
log.debug("#test start node {}", node);
|
||||
logger.debug("#test start node {}", node);
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
boolean waitForSelf = currentTime - timeStarts[node] < TIMEOUT_START_SERVER;
|
||||
boolean waitForPrevious = node > 0 && currentTime - timeStarts[node - 1] < TIMEOUT_START_SERVER;
|
||||
|
@ -2000,10 +2000,10 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
Thread.sleep(TIMEOUT_START_SERVER);
|
||||
}
|
||||
timeStarts[node] = System.currentTimeMillis();
|
||||
log.debug("starting server {}", servers[node]);
|
||||
logger.debug("starting server {}", servers[node]);
|
||||
servers[node].start();
|
||||
|
||||
log.debug("started server {}", servers[node]);
|
||||
logger.debug("started server {}", servers[node]);
|
||||
waitForServerToStart(servers[node]);
|
||||
|
||||
if (servers[node].getStorageManager() != null && isForceUniqueStorageManagerIds()) {
|
||||
|
@ -2028,8 +2028,8 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
}
|
||||
|
||||
protected void stopServers(final int... nodes) throws Exception {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Stopping nodes {}", Arrays.toString(nodes));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Stopping nodes {}", Arrays.toString(nodes));
|
||||
}
|
||||
|
||||
Exception exception = null;
|
||||
|
@ -2043,9 +2043,9 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
|
|||
|
||||
timeStarts[node] = System.currentTimeMillis();
|
||||
|
||||
log.debug("stopping server {}", node);
|
||||
logger.debug("stopping server {}", node);
|
||||
servers[node].stop();
|
||||
log.debug("server {} stopped", node);
|
||||
logger.debug("server {} stopped", node);
|
||||
} catch (Exception e) {
|
||||
exception = e;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class ClusteredGroupingTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Rule
|
||||
public RetryRule retryRule = new RetryRule(2);
|
||||
|
@ -599,12 +599,12 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
groups.add(group);
|
||||
}
|
||||
producer.send(message);
|
||||
log.trace("Sent message to server 1 with dupID: {}", dupID);
|
||||
logger.trace("Sent message to server 1 with dupID: {}", dupID);
|
||||
}
|
||||
|
||||
session.commit();
|
||||
totalMessageProduced.addAndGet(500);
|
||||
log.trace("Sent block of 500 messages to server 1. Total sent: {}", totalMessageProduced.get());
|
||||
logger.trace("Sent block of 500 messages to server 1. Total sent: {}", totalMessageProduced.get());
|
||||
session.close();
|
||||
|
||||
// need thread pool to service both consumers and producers plus a thread to cycle nodes
|
||||
|
@ -626,7 +626,7 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
String group = groupx;
|
||||
|
||||
String basicID = UUID.randomUUID().toString();
|
||||
log.debug("Starting producer thread...");
|
||||
logger.debug("Starting producer thread...");
|
||||
ClientSessionFactory factory;
|
||||
ClientSession session = null;
|
||||
ClientProducer producer = null;
|
||||
|
@ -644,12 +644,12 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
} else {
|
||||
factory = sf0;
|
||||
}
|
||||
log.debug("Creating producer session factory to node {}", targetServer);
|
||||
logger.debug("Creating producer session factory to node {}", targetServer);
|
||||
session = addClientSession(factory.createSession(false, true, true));
|
||||
producer = addClientProducer(session.createProducer(ADDRESS));
|
||||
} catch (Exception e) {
|
||||
errors.incrementAndGet();
|
||||
log.warn("Producer thread couldn't establish connection", e);
|
||||
logger.warn("Producer thread couldn't establish connection", e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -665,11 +665,11 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
totalMessageProduced.incrementAndGet();
|
||||
messageCount++;
|
||||
} catch (ActiveMQException e) {
|
||||
log.warn("Producer thread threw exception while sending messages to {}: {}", targetServer, e.getMessage());
|
||||
logger.warn("Producer thread threw exception while sending messages to {}: {}", targetServer, e.getMessage());
|
||||
// in case of a failure we change the group to make possible errors more likely
|
||||
group = group + "afterFail";
|
||||
} catch (Exception e) {
|
||||
log.warn("Producer thread threw unexpected exception while sending messages to {}: {}", targetServer, e.getMessage());
|
||||
logger.warn("Producer thread threw unexpected exception while sending messages to {}: {}", targetServer, e.getMessage());
|
||||
group = group + "afterFail";
|
||||
break;
|
||||
}
|
||||
|
@ -711,13 +711,13 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
log.debug("Waiting to start consumer thread...");
|
||||
logger.debug("Waiting to start consumer thread...");
|
||||
okToConsume.await(20, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
log.debug("Starting consumer thread...");
|
||||
logger.debug("Starting consumer thread...");
|
||||
ClientSessionFactory factory;
|
||||
ClientSession session = null;
|
||||
ClientConsumer consumer = null;
|
||||
|
@ -734,14 +734,14 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
} else {
|
||||
factory = sf0;
|
||||
}
|
||||
log.debug("Creating consumer session factory to node {}", targetServer);
|
||||
logger.debug("Creating consumer session factory to node {}", targetServer);
|
||||
session = addClientSession(factory.createSession(false, false, true));
|
||||
consumer = addClientConsumer(session.createConsumer(QUEUE));
|
||||
session.start();
|
||||
consumerCounter.incrementAndGet();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.debug("Consumer thread couldn't establish connection", e);
|
||||
logger.debug("Consumer thread couldn't establish connection", e);
|
||||
errors.incrementAndGet();
|
||||
return;
|
||||
}
|
||||
|
@ -754,13 +754,13 @@ public class ClusteredGroupingTest extends ClusterTestBase {
|
|||
return;
|
||||
}
|
||||
m.acknowledge();
|
||||
log.trace("Consumed message {} from server {}. Total consumed: {}", m.getStringProperty(Message.HDR_DUPLICATE_DETECTION_ID), targetServer, totalMessagesConsumed.incrementAndGet());
|
||||
logger.trace("Consumed message {} from server {}. Total consumed: {}", m.getStringProperty(Message.HDR_DUPLICATE_DETECTION_ID), targetServer, totalMessagesConsumed.incrementAndGet());
|
||||
} catch (ActiveMQException e) {
|
||||
errors.incrementAndGet();
|
||||
log.warn("Consumer thread threw exception while receiving messages from server {}.: {}", targetServer, e.getMessage());
|
||||
logger.warn("Consumer thread threw exception while receiving messages from server {}.: {}", targetServer, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
errors.incrementAndGet();
|
||||
log.warn("Consumer thread threw unexpected exception while receiving messages from server {}.: {}", targetServer, e.getMessage());
|
||||
logger.warn("Consumer thread threw unexpected exception while receiving messages from server {}.: {}", targetServer, e.getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class MessageRedistributionTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@Before
|
||||
|
@ -91,7 +91,7 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
public void testRedistributionWithMessageGroups() throws Exception {
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
log.debug("Doing test");
|
||||
logger.debug("Doing test");
|
||||
|
||||
getServer(0).getConfiguration().setGroupingHandlerConfiguration(new GroupingHandlerConfiguration().setName(new SimpleString("handler")).setType(GroupingHandlerConfiguration.TYPE.LOCAL).setAddress(new SimpleString("queues")));
|
||||
getServer(1).getConfiguration().setGroupingHandlerConfiguration(new GroupingHandlerConfiguration().setName(new SimpleString("handler")).setType(GroupingHandlerConfiguration.TYPE.REMOTE).setAddress(new SimpleString("queues")));
|
||||
|
@ -170,7 +170,7 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
message.acknowledge();
|
||||
Assert.assertNotNull(message.getSimpleStringProperty(Message.HDR_GROUP_ID));
|
||||
}
|
||||
log.debug("Test done");
|
||||
logger.debug("Test done");
|
||||
}
|
||||
|
||||
//https://issues.jboss.org/browse/HORNETQ-1057
|
||||
|
@ -178,7 +178,7 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
public void testRedistributionStopsWhenConsumerAdded() throws Exception {
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
log.debug("Doing test");
|
||||
logger.debug("Doing test");
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -208,14 +208,14 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
Bindable bindable = servers[0].getPostOffice().getBinding(new SimpleString("queue0")).getBindable();
|
||||
String debug = ((QueueImpl) bindable).debug();
|
||||
Assert.assertFalse(debug.contains(Redistributor.class.getName()));
|
||||
log.debug("Test done");
|
||||
logger.debug("Test done");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedistributionWhenConsumerIsClosed() throws Exception {
|
||||
setupCluster(MessageLoadBalancingType.ON_DEMAND);
|
||||
|
||||
log.debug("Doing test");
|
||||
logger.debug("Doing test");
|
||||
|
||||
startServers(0, 1, 2);
|
||||
|
||||
|
@ -249,7 +249,7 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
|
||||
verifyReceiveRoundRobinInSomeOrderWithCounts(false, ids1, 0, 2);
|
||||
|
||||
log.debug("Test done");
|
||||
logger.debug("Test done");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -331,7 +331,7 @@ public class MessageRedistributionTest extends ClusterTestBase {
|
|||
Assert.assertNull(consumer1.receiveImmediate());
|
||||
Assert.assertNull(consumer2.receiveImmediate());
|
||||
|
||||
log.debug("Test done");
|
||||
logger.debug("Test done");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class OnewayTwoNodeClusterTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@Before
|
||||
|
@ -145,19 +145,19 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase {
|
|||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
OnewayTwoNodeClusterTest.log.debug("stopping server 1");
|
||||
OnewayTwoNodeClusterTest.logger.debug("stopping server 1");
|
||||
|
||||
stopServers(1);
|
||||
|
||||
waitForTopology(servers[0], 1);
|
||||
|
||||
OnewayTwoNodeClusterTest.log.debug("restarting server 1({})", servers[1].getIdentity());
|
||||
OnewayTwoNodeClusterTest.logger.debug("restarting server 1({})", servers[1].getIdentity());
|
||||
|
||||
startServers(1);
|
||||
|
||||
waitForTopology(servers[0], 2);
|
||||
|
||||
log.debug("Server 1 id={}", servers[1].getNodeID());
|
||||
logger.debug("Server 1 id={}", servers[1].getNodeID());
|
||||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class SimpleSymmetricClusterTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
|
||||
|
@ -71,19 +71,19 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase {
|
|||
|
||||
startServers(0, 1, 2, 3, 4, 5);
|
||||
|
||||
log.debug("");
|
||||
logger.debug("");
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
log.debug(servers[i].describe());
|
||||
log.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString()));
|
||||
logger.debug(servers[i].describe());
|
||||
logger.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString()));
|
||||
}
|
||||
log.debug("");
|
||||
logger.debug("");
|
||||
|
||||
log.debug("");
|
||||
logger.debug("");
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
log.debug(servers[i].describe());
|
||||
log.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString()));
|
||||
logger.debug(servers[i].describe());
|
||||
logger.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString()));
|
||||
}
|
||||
log.debug("");
|
||||
logger.debug("");
|
||||
|
||||
stopServers(0, 1, 2, 3, 4, 5);
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase {
|
|||
public void _testLoop() throws Throwable {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
loopNumber = i;
|
||||
log.debug("#test {}", i);
|
||||
logger.debug("#test {}", i);
|
||||
testSimple();
|
||||
tearDown();
|
||||
setUp();
|
||||
|
@ -315,7 +315,7 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase {
|
|||
waitForTopology(servers[i], 5);
|
||||
}
|
||||
|
||||
log.debug("All the servers have been started already!");
|
||||
logger.debug("All the servers have been started already!");
|
||||
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
setupSessionFactory(i, isNetty());
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class SymmetricClusterTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@Before
|
||||
|
@ -275,14 +275,14 @@ public class SymmetricClusterTest extends ClusterTestBase {
|
|||
|
||||
@Test
|
||||
public void testRoundRobinMultipleQueues() throws Exception {
|
||||
log.debug("starting");
|
||||
logger.debug("starting");
|
||||
setupCluster();
|
||||
|
||||
log.debug("setup cluster");
|
||||
logger.debug("setup cluster");
|
||||
|
||||
startServers();
|
||||
|
||||
log.debug("started servers");
|
||||
logger.debug("started servers");
|
||||
|
||||
setupSessionFactory(0, isNetty());
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
@ -290,7 +290,7 @@ public class SymmetricClusterTest extends ClusterTestBase {
|
|||
setupSessionFactory(3, isNetty());
|
||||
setupSessionFactory(4, isNetty());
|
||||
|
||||
log.debug("Set up session factories");
|
||||
logger.debug("Set up session factories");
|
||||
|
||||
createQueue(0, "queues.testaddress", "queue0", null, false);
|
||||
createQueue(1, "queues.testaddress", "queue0", null, false);
|
||||
|
@ -310,7 +310,7 @@ public class SymmetricClusterTest extends ClusterTestBase {
|
|||
createQueue(3, "queues.testaddress", "queue2", null, false);
|
||||
createQueue(4, "queues.testaddress", "queue2", null, false);
|
||||
|
||||
log.debug("created queues");
|
||||
logger.debug("created queues");
|
||||
|
||||
addConsumer(0, 0, "queue0", null);
|
||||
addConsumer(1, 1, "queue0", null);
|
||||
|
@ -330,7 +330,7 @@ public class SymmetricClusterTest extends ClusterTestBase {
|
|||
addConsumer(13, 3, "queue2", null);
|
||||
addConsumer(14, 4, "queue2", null);
|
||||
|
||||
log.debug("added consumers");
|
||||
logger.debug("added consumers");
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 3, 3, true);
|
||||
waitForBindings(1, "queues.testaddress", 3, 3, true);
|
||||
|
@ -344,23 +344,23 @@ public class SymmetricClusterTest extends ClusterTestBase {
|
|||
waitForBindings(3, "queues.testaddress", 12, 12, false);
|
||||
waitForBindings(4, "queues.testaddress", 12, 12, false);
|
||||
|
||||
log.debug("waited for bindings");
|
||||
logger.debug("waited for bindings");
|
||||
|
||||
send(0, "queues.testaddress", 10, false, null);
|
||||
|
||||
log.debug("sent messages");
|
||||
logger.debug("sent messages");
|
||||
|
||||
verifyReceiveRoundRobinInSomeOrder(10, 0, 1, 2, 3, 4);
|
||||
|
||||
log.debug("verified 1");
|
||||
logger.debug("verified 1");
|
||||
|
||||
verifyReceiveRoundRobinInSomeOrder(10, 5, 6, 7, 8, 9);
|
||||
|
||||
log.debug("verified 2");
|
||||
logger.debug("verified 2");
|
||||
|
||||
verifyReceiveRoundRobinInSomeOrder(10, 10, 11, 12, 13, 14);
|
||||
|
||||
log.debug("verified 3");
|
||||
logger.debug("verified 3");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -54,7 +54,7 @@ import java.lang.invoke.MethodHandles;
|
|||
*/
|
||||
public class AsynchronousFailoverTest extends FailoverTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private volatile CountDownSessionFailureListener listener;
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
try {
|
||||
doTestNonTransactional(this);
|
||||
} catch (Throwable e) {
|
||||
log.error("Test failed", e);
|
||||
logger.error("Test failed", e);
|
||||
addException(e);
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
running = false;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
log.error("Test failed", e);
|
||||
logger.error("Test failed", e);
|
||||
addException(e);
|
||||
}
|
||||
}
|
||||
|
@ -124,9 +124,9 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
void checkForExceptions() throws Throwable {
|
||||
if (errors.size() > 0) {
|
||||
log.warn("Exceptions on test:");
|
||||
logger.warn("Exceptions on test:");
|
||||
for (Throwable e : errors) {
|
||||
log.warn(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
// throwing the first error that happened on the Runnable
|
||||
throw errors.get(0);
|
||||
|
@ -141,7 +141,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
try {
|
||||
for (int i = 0; i < numIts; i++) {
|
||||
log.debug("Iteration {}", i);
|
||||
logger.debug("Iteration {}", i);
|
||||
//set block timeout to 10 sec to reduce test time.
|
||||
ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(30).setRetryInterval(100).setConfirmationWindowSize(10 * 1024 * 1024).setCallTimeout(10000).setCallFailoverTimeout(10000);
|
||||
|
||||
|
@ -162,15 +162,15 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
long randomDelay = (long) (2000 * Math.random());
|
||||
|
||||
log.debug("Sleeping {}", randomDelay);
|
||||
logger.debug("Sleeping {}", randomDelay);
|
||||
|
||||
Thread.sleep(randomDelay);
|
||||
|
||||
log.debug("Failing asynchronously");
|
||||
logger.debug("Failing asynchronously");
|
||||
|
||||
// Simulate failure on connection
|
||||
synchronized (lockFail) {
|
||||
log.debug("#test crashing test");
|
||||
logger.debug("#test crashing test");
|
||||
crash(createSession);
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
runnable.setFailed();
|
||||
|
||||
log.debug("Fail complete");
|
||||
logger.debug("Fail complete");
|
||||
|
||||
t.join(TimeUnit.SECONDS.toMillis(120));
|
||||
if (t.isAlive()) {
|
||||
|
@ -221,7 +221,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
private void doTestNonTransactional(final TestRunner runner) throws Exception {
|
||||
while (!runner.isFailed()) {
|
||||
log.debug("looping");
|
||||
logger.debug("looping");
|
||||
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
|
@ -249,7 +249,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
retry = false;
|
||||
} catch (ActiveMQUnBlockedException ube) {
|
||||
log.debug("exception when sending message with counter {}", i);
|
||||
logger.debug("exception when sending message with counter {}", i);
|
||||
|
||||
ube.printStackTrace();
|
||||
|
||||
|
@ -271,7 +271,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
retry = false;
|
||||
} catch (ActiveMQUnBlockedException ube) {
|
||||
log.debug("exception when creating consumer");
|
||||
logger.debug("exception when creating consumer");
|
||||
|
||||
retry = true;
|
||||
|
||||
|
@ -302,7 +302,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
Assert.fail("got another counter gap at " + count + ": " + counts);
|
||||
} else {
|
||||
if (lastCount != -1) {
|
||||
log.debug("got first counter gap at {}", count);
|
||||
logger.debug("got first counter gap at {}", count);
|
||||
counterGap = true;
|
||||
}
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
executionId++;
|
||||
|
||||
log.debug("#test doTestTransactional starting now. Execution {}", executionId);
|
||||
logger.debug("#test doTestTransactional starting now. Execution {}", executionId);
|
||||
|
||||
try {
|
||||
|
||||
|
@ -375,12 +375,12 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
|
||||
addPayload(message);
|
||||
|
||||
log.debug("Sending message {}", message);
|
||||
logger.debug("Sending message {}", message);
|
||||
|
||||
producer.send(message);
|
||||
}
|
||||
|
||||
log.debug("Sending commit");
|
||||
logger.debug("Sending commit");
|
||||
session.commit();
|
||||
|
||||
retry = false;
|
||||
|
@ -388,19 +388,19 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
logAndSystemOut("#test duplicate id rejected on sending");
|
||||
break;
|
||||
} catch (ActiveMQTransactionRolledBackException trbe) {
|
||||
log.debug("#test transaction rollback retrying on sending");
|
||||
logger.debug("#test transaction rollback retrying on sending");
|
||||
// OK
|
||||
retry = true;
|
||||
} catch (ActiveMQUnBlockedException ube) {
|
||||
log.debug("#test transaction rollback retrying on sending");
|
||||
logger.debug("#test transaction rollback retrying on sending");
|
||||
// OK
|
||||
retry = true;
|
||||
} catch (ActiveMQTransactionOutcomeUnknownException toue) {
|
||||
log.debug("#test transaction rollback retrying on sending");
|
||||
logger.debug("#test transaction rollback retrying on sending");
|
||||
// OK
|
||||
retry = true;
|
||||
} catch (ActiveMQObjectClosedException closedException) {
|
||||
log.debug("#test producer closed, retrying on sending...");
|
||||
logger.debug("#test producer closed, retrying on sending...");
|
||||
Thread.sleep(2000);
|
||||
// OK
|
||||
retry = true;
|
||||
|
@ -410,7 +410,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
Thread.sleep(2000);
|
||||
retry = true;
|
||||
} catch (ActiveMQException e) {
|
||||
log.debug("#test Exception {}", e.getMessage(), e);
|
||||
logger.debug("#test Exception {}", e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
@ -446,19 +446,19 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
session.start();
|
||||
|
||||
for (int i = 0; i < numMessages; i++) {
|
||||
log.debug("Consumer receiving message {}", i);
|
||||
logger.debug("Consumer receiving message {}", i);
|
||||
|
||||
ClientMessage message = consumer.receive(60000);
|
||||
if (message == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
log.debug("Received message {}", message);
|
||||
logger.debug("Received message {}", message);
|
||||
|
||||
int count = message.getIntProperty("counter");
|
||||
|
||||
if (count != i) {
|
||||
log.warn("count was received out of order, {}!={}", count, i);
|
||||
logger.warn("count was received out of order, {}!={}", count, i);
|
||||
}
|
||||
|
||||
msgs.add(count);
|
||||
|
@ -466,7 +466,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
message.acknowledge();
|
||||
}
|
||||
|
||||
log.debug("#test commit");
|
||||
logger.debug("#test commit");
|
||||
try {
|
||||
session.commit();
|
||||
} catch (ActiveMQTransactionRolledBackException trbe) {
|
||||
|
@ -476,7 +476,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
} catch (ActiveMQException e) {
|
||||
// This could eventually happen
|
||||
// We will get rid of this when we implement 2 phase commit on failover
|
||||
log.warn("exception during commit, continue {}", e.getMessage(), e);
|
||||
logger.warn("exception during commit, continue {}", e.getMessage(), e);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -487,9 +487,9 @@ public class AsynchronousFailoverTest extends FailoverTestBase {
|
|||
assertTrue("msgs.size is expected to be " + numMessages + " but it was " + msgs.size(), msgs.size() == numMessages);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
if (log.isDebugEnabled()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String dumpMessage = "Thread dump, messagesReceived = " + msgs.size();
|
||||
log.debug(threadDump(dumpMessage));
|
||||
logger.debug(threadDump(dumpMessage));
|
||||
}
|
||||
logAndSystemOut(e.getMessage() + " messages received");
|
||||
for (Integer msg : msgs) {
|
||||
|
|
|
@ -60,8 +60,8 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa
|
|||
send(2, QUEUES_TESTADDRESS, 10, false, null);
|
||||
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
|
||||
Thread.sleep(1000);
|
||||
log.debug("######### Topology on client = {} locator = {}", locators[0].getTopology().describe(), locators[0]);
|
||||
log.debug("######### Crashing it........., sfs[0] = {}", sfs[0]);
|
||||
logger.debug("######### Topology on client = {} locator = {}", locators[0].getTopology().describe(), locators[0]);
|
||||
logger.debug("######### Crashing it........., sfs[0] = {}", sfs[0]);
|
||||
failNode(0);
|
||||
|
||||
waitForFailoverTopology(4, 3, 1, 2);
|
||||
|
@ -79,7 +79,7 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa
|
|||
// activated backup nodes
|
||||
waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
|
||||
|
||||
ClusterWithBackupFailoverTestBase.log.debug("** now sending");
|
||||
ClusterWithBackupFailoverTestBase.logger.debug("** now sending");
|
||||
|
||||
send(0, QUEUES_TESTADDRESS, 10, false, null);
|
||||
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
|
||||
|
@ -269,7 +269,7 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa
|
|||
// activated backup nodes
|
||||
waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false);
|
||||
|
||||
ClusterWithBackupFailoverTestBase.log.debug("** now sending");
|
||||
ClusterWithBackupFailoverTestBase.logger.debug("** now sending");
|
||||
|
||||
send(0, QUEUES_TESTADDRESS, 10, false, null);
|
||||
verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2);
|
||||
|
|
|
@ -34,7 +34,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
|
|||
protected static final String QUEUE_NAME = "queue0";
|
||||
protected static final String QUEUES_TESTADDRESS = "queues.testaddress";
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected abstract void setupCluster(MessageLoadBalancingType messageLoadBalancingType) throws Exception;
|
||||
|
||||
|
@ -75,7 +75,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase
|
|||
* @throws Exception
|
||||
*/
|
||||
protected void failNode(final int node, final int originalLiveNode) throws Exception {
|
||||
log.debug("*** failing node {}", node);
|
||||
logger.debug("*** failing node {}", node);
|
||||
|
||||
ActiveMQServer server = getServer(node);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class FailBackAutoTest extends FailoverTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final int NUM_MESSAGES = 100;
|
||||
private ServerLocatorInternal locator;
|
||||
|
@ -74,9 +74,9 @@ public class FailBackAutoTest extends FailoverTestBase {
|
|||
|
||||
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
||||
|
||||
log.debug("backup (nowLive) topology = {}", backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe());
|
||||
logger.debug("backup (nowLive) topology = {}", backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe());
|
||||
|
||||
log.debug("Server Crash!!!");
|
||||
logger.debug("Server Crash!!!");
|
||||
|
||||
ClientProducer producer = session.createProducer(ADDRESS);
|
||||
|
||||
|
@ -96,12 +96,12 @@ public class FailBackAutoTest extends FailoverTestBase {
|
|||
|
||||
session.addFailureListener(listener);
|
||||
|
||||
log.debug("******* starting live server back");
|
||||
logger.debug("******* starting live server back");
|
||||
liveServer.start();
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
log.debug("After failback: {}", locator.getTopology().describe());
|
||||
logger.debug("After failback: {}", locator.getTopology().describe());
|
||||
|
||||
assertTrue(latch2.await(5, TimeUnit.SECONDS));
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class FailBackAutoTest extends FailoverTestBase {
|
|||
|
||||
session.addFailureListener(listener);
|
||||
|
||||
log.debug("Crashing live server...");
|
||||
logger.debug("Crashing live server...");
|
||||
|
||||
liveServer.crash(session);
|
||||
|
||||
|
@ -165,7 +165,7 @@ public class FailBackAutoTest extends FailoverTestBase {
|
|||
listener = new CountDownSessionFailureListener(session);
|
||||
|
||||
session.addFailureListener(listener);
|
||||
log.debug("restarting live node now");
|
||||
logger.debug("restarting live node now");
|
||||
liveServer.start();
|
||||
|
||||
assertTrue("expected a session failure 1", listener.getLatch().await(5, TimeUnit.SECONDS));
|
||||
|
@ -184,7 +184,7 @@ public class FailBackAutoTest extends FailoverTestBase {
|
|||
|
||||
waitForBackup(sf, 10);
|
||||
|
||||
log.debug("Crashing live server again...");
|
||||
logger.debug("Crashing live server again...");
|
||||
|
||||
liveServer.crash();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class FailoverOnFlowControlTest extends FailoverTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
@Test
|
||||
public void testOverflowSend() throws Exception {
|
||||
ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setProducerWindowSize(1000).setRetryInterval(100);
|
||||
|
@ -51,14 +51,14 @@ public class FailoverOnFlowControlTest extends FailoverTestBase {
|
|||
|
||||
@Override
|
||||
public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException {
|
||||
log.debug("Intercept...{}", packet.getClass().getName());
|
||||
logger.debug("Intercept...{}", packet.getClass().getName());
|
||||
|
||||
if (packet instanceof SessionProducerCreditsMessage) {
|
||||
SessionProducerCreditsMessage credit = (SessionProducerCreditsMessage) packet;
|
||||
|
||||
log.debug("Credits: {}", credit.getCredits());
|
||||
logger.debug("Credits: {}", credit.getCredits());
|
||||
if (count.incrementAndGet() == 2) {
|
||||
log.debug("### crashing server");
|
||||
logger.debug("### crashing server");
|
||||
try {
|
||||
InVMConnection.setFlushEnabled(false);
|
||||
crash(false, sessionList.get(0));
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
public class PluggableQuorumNettyNoGroupNameReplicatedFailoverTest extends FailoverTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected void beforeWaitForRemoteBackupSynchronization() {
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ public class PluggableQuorumNettyNoGroupNameReplicatedFailoverTest extends Failo
|
|||
|
||||
@Override
|
||||
protected void decrementActivationSequenceForForceRestartOf(TestableServer testableServer) throws Exception {
|
||||
doDecrementActivationSequenceForForceRestartOf(log, nodeManager, managerConfiguration);
|
||||
doDecrementActivationSequenceForForceRestartOf(logger, nodeManager, managerConfiguration);
|
||||
}
|
||||
|
||||
public static void doDecrementActivationSequenceForForceRestartOf(Logger log, NodeManager nodeManager, DistributedPrimitiveManagerConfiguration distributedPrimitiveManagerConfiguration) throws Exception {
|
||||
|
@ -237,7 +237,7 @@ public class PluggableQuorumNettyNoGroupNameReplicatedFailoverTest extends Failo
|
|||
if (!mutableLong.compareAndSet(localActivation + 1, localActivation)) {
|
||||
throw new Exception("Failed to decrement coordinated activation sequence to:" + localActivation + ", not +1 : " + mutableLong.get());
|
||||
}
|
||||
log.warn("Intentionally decrementing coordinated activation sequence for test, may result is lost data");
|
||||
logger.warn("Intentionally decrementing coordinated activation sequence for test, may result is lost data");
|
||||
|
||||
} finally {
|
||||
fileBasedPrimitiveManager.stop();
|
||||
|
|
|
@ -28,7 +28,7 @@ import static org.apache.activemq.artemis.tests.integration.cluster.failover.quo
|
|||
|
||||
public class PluggableQuorumReplicatedLargeMessageFailoverTest extends LargeMessageFailoverTest {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
@Override
|
||||
protected void createConfigs() throws Exception {
|
||||
createPluggableReplicatedConfigs();
|
||||
|
@ -65,6 +65,6 @@ public class PluggableQuorumReplicatedLargeMessageFailoverTest extends LargeMess
|
|||
|
||||
@Override
|
||||
protected void decrementActivationSequenceForForceRestartOf(TestableServer liveServer) throws Exception {
|
||||
doDecrementActivationSequenceForForceRestartOf(log, nodeManager, managerConfiguration);
|
||||
doDecrementActivationSequenceForForceRestartOf(logger, nodeManager, managerConfiguration);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReattachSupportTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
private static final int RECEIVE_TIMEOUT = 30000;
|
||||
|
@ -358,7 +358,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestB(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -438,7 +438,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
|
||||
}
|
||||
|
||||
|
@ -539,7 +539,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestD(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -664,7 +664,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
// Now with synchronous receive()
|
||||
|
@ -723,7 +723,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestF(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -782,7 +782,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestG(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -855,7 +855,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestH(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -930,7 +930,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestI(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
|
@ -1230,7 +1230,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
try {
|
||||
message.acknowledge();
|
||||
} catch (ActiveMQException me) {
|
||||
log.error("Failed to process", me);
|
||||
logger.error("Failed to process", me);
|
||||
}
|
||||
|
||||
if (done) {
|
||||
|
@ -1247,14 +1247,14 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
if (tn == threadNum && cnt != c.intValue()) {
|
||||
failure = "Invalid count, expected " + threadNum + ":" + c + " got " + cnt;
|
||||
log.error(failure);
|
||||
logger.error(failure);
|
||||
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
if (!checkSize(message)) {
|
||||
failure = "Invalid size on message";
|
||||
log.error(failure);
|
||||
logger.error(failure);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
@Rule
|
||||
public RetryRule retryRule = new RetryRule(2);
|
||||
|
||||
|
@ -78,7 +78,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas
|
|||
final boolean failOnCreateConnection,
|
||||
final long failDelay) throws Exception {
|
||||
for (int its = 0; its < numIts; its++) {
|
||||
log.debug("Beginning iteration {}", its);
|
||||
logger.debug("Beginning iteration {}", its);
|
||||
|
||||
start();
|
||||
|
||||
|
@ -111,7 +111,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas
|
|||
} catch (Throwable t) {
|
||||
throwable = t;
|
||||
|
||||
log.error("Failed to run test", t);
|
||||
logger.error("Failed to run test", t);
|
||||
|
||||
// Case a failure happened here, it should print the Thread dump
|
||||
// Sending it to System.out, as it would show on the Tests report
|
||||
|
@ -187,7 +187,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas
|
|||
|
||||
public void checkFail() {
|
||||
if (throwable != null) {
|
||||
log.error("Test failed: {}", failReason, throwable);
|
||||
logger.error("Test failed: {}", failReason, throwable);
|
||||
}
|
||||
if (failReason != null) {
|
||||
Assert.fail(failReason);
|
||||
|
@ -213,7 +213,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas
|
|||
|
||||
@Override
|
||||
public synchronized void run() {
|
||||
log.debug("** Failing connection");
|
||||
logger.debug("** Failing connection");
|
||||
|
||||
RemotingConnectionImpl conn = (RemotingConnectionImpl) ((ClientSessionInternal) session).getConnection();
|
||||
|
||||
|
@ -224,7 +224,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas
|
|||
conn.fail(new ActiveMQNotConnectedException("blah"));
|
||||
}
|
||||
|
||||
log.debug("** Fail complete");
|
||||
logger.debug("** Fail complete");
|
||||
|
||||
cancel();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
@Rule
|
||||
public RetryRule retryRule = new RetryRule(2);
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
private static final int RECEIVE_TIMEOUT = 10000;
|
||||
|
@ -205,7 +205,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
final int numIts = getNumIterations();
|
||||
|
||||
for (int its = 0; its < numIts; its++) {
|
||||
log.debug("####{} iteration #{}", getName(), its);
|
||||
logger.debug("####{} iteration #{}", getName(), its);
|
||||
start();
|
||||
ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024);
|
||||
|
||||
|
@ -281,7 +281,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
try {
|
||||
message.acknowledge();
|
||||
} catch (ActiveMQException me) {
|
||||
RandomReattachTest.log.error("Failed to process", me);
|
||||
RandomReattachTest.logger.error("Failed to process", me);
|
||||
}
|
||||
|
||||
if (count == numMessages) {
|
||||
|
@ -323,7 +323,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestB(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -422,7 +422,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
|
||||
}
|
||||
|
||||
|
@ -563,7 +563,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestD(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -698,7 +698,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
// Now with synchronous receive()
|
||||
|
@ -776,7 +776,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestF(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -860,7 +860,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestG(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -972,7 +972,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestH(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -1088,7 +1088,7 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.debug("duration {}", (end - start));
|
||||
logger.debug("duration {}", (end - start));
|
||||
}
|
||||
|
||||
protected void doTestI(final ClientSessionFactory sf) throws Exception {
|
||||
|
@ -1271,11 +1271,11 @@ public class RandomReattachTest extends ActiveMQTestBase {
|
|||
|
||||
@Override
|
||||
public synchronized void run() {
|
||||
log.debug("** Failing connection");
|
||||
logger.debug("** Failing connection");
|
||||
|
||||
session.getConnection().fail(new ActiveMQNotConnectedException("oops"));
|
||||
|
||||
log.debug("** Fail complete");
|
||||
logger.debug("** Fail complete");
|
||||
|
||||
cancel();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class ClusterRestartTest extends ClusterTestBase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testRestartWithQueuesCreateInDiffOrder() throws Exception {
|
||||
|
@ -42,8 +42,8 @@ public class ClusterRestartTest extends ClusterTestBase {
|
|||
|
||||
startServers(0, 1);
|
||||
|
||||
log.debug("server 0 = {}", getServer(0).getNodeID());
|
||||
log.debug("server 1 = {}", getServer(1).getNodeID());
|
||||
logger.debug("server 0 = {}", getServer(0).getNodeID());
|
||||
logger.debug("server 1 = {}", getServer(1).getNodeID());
|
||||
|
||||
setupSessionFactory(0, isNetty(), 15);
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
@ -91,7 +91,7 @@ public class ClusterRestartTest extends ClusterTestBase {
|
|||
sendInRange(1, "queues.testaddress", 10, 20, false, null);
|
||||
|
||||
verifyReceiveAllInRange(0, 20, 0);
|
||||
log.debug("*****************************************************************************");
|
||||
logger.debug("*****************************************************************************");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -105,8 +105,8 @@ public class ClusterRestartTest extends ClusterTestBase {
|
|||
|
||||
startServers(0, 1);
|
||||
|
||||
log.debug("server 0 = {}", getServer(0).getNodeID());
|
||||
log.debug("server 1 = {}", getServer(1).getNodeID());
|
||||
logger.debug("server 0 = {}", getServer(0).getNodeID());
|
||||
logger.debug("server 1 = {}", getServer(1).getNodeID());
|
||||
setupSessionFactory(0, isNetty(), 15);
|
||||
setupSessionFactory(1, isNetty());
|
||||
|
||||
|
@ -134,11 +134,11 @@ public class ClusterRestartTest extends ClusterTestBase {
|
|||
|
||||
sendInRange(1, "queues.testaddress", 0, 10, true, null);
|
||||
|
||||
log.debug("stopping******************************************************");
|
||||
logger.debug("stopping******************************************************");
|
||||
stopServers(0);
|
||||
|
||||
sendInRange(1, "queues.testaddress", 10, 20, true, null);
|
||||
log.debug("stopped******************************************************");
|
||||
logger.debug("stopped******************************************************");
|
||||
startServers(0);
|
||||
|
||||
waitForBindings(0, "queues.testaddress", 1, 0, true);
|
||||
|
@ -151,14 +151,14 @@ public class ClusterRestartTest extends ClusterTestBase {
|
|||
addConsumer(1, 0, "queue10", null);
|
||||
|
||||
verifyReceiveRoundRobin(0, 20, 0, 1);
|
||||
log.debug("*****************************************************************************");
|
||||
logger.debug("*****************************************************************************");
|
||||
}
|
||||
|
||||
private void printBindings(final int num) throws Exception {
|
||||
for (int i = 0; i < num; i++) {
|
||||
Collection<Binding> bindings0 = getServer(i).getPostOffice().getBindingsForAddress(new SimpleString("queues.testaddress")).getBindings();
|
||||
for (Binding binding : bindings0) {
|
||||
log.debug("{} on node {} at {}", binding, i, binding.getID());
|
||||
logger.debug("{} on node {} at {}", binding, i, binding.getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,11 +29,11 @@ import java.lang.invoke.MethodHandles;
|
|||
|
||||
public class Outgoing implements Interceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
|
||||
log.debug("Outgoin:Packet : {}", packet);
|
||||
logger.debug("Outgoin:Packet : {}", packet);
|
||||
if (packet.getType() == PacketImpl.SESS_SEND) {
|
||||
SessionSendMessage p = (SessionSendMessage) packet;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue