this.messageSize = messageSize;
}
@Override
public void run() {
SCClient sc = new SCClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
long start = System.currentTimeMillis();
try {
// wait for signal to start cycle
beforeAttachSignal.await();
try {
sc.attach();
} catch (Exception e) {
testLogger.info("attach failed");
} finally {
attachedSignal.countDown();
}
afterAttachSignal.await();
for (int i = 0; i < sessionCycles; i++) {
SCSessionService service = sc.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
service.createSession(300, scMessage, new TestSessionServiceMessageCallback(service));
for (int j = 0; j < executeCycles; j++) {
service.execute(new SCMessage(new byte[messageSize]));
counter.increment();
}
service.deleteSession();
}
} catch (Exception e) {
LOGGER.fatal("run", e);
} finally {
try {
sc.detach();
} catch (Exception e) {
testLogger.info("detach failed");
}
long stop = System.currentTimeMillis();
// signal that this worker is done