Integer end;
end = generator.nextInt(10);
for (i = 0; i <= end; i++) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
Log log = new Log();
// logger.info("Loop 1 " + String.valueOf(i));
log.setHostname("had" + i + ".sc9.admob.int");
log.setTimestamp("332423");
log.setName("dmJob100");
log.setValue("Log line as following: random string " + generator.nextInt());
log.setError("Line explaining error 1 ");
log.setStatus(2);
out.writeObject(log);
out.flush();
// Send message to rabbit
MessageManager.getInstance().publishMessage(baos.toByteArray(), rabbitExchange);
}
end = generator.nextInt(10);
for (i = 0; i <= end; i++) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
Log log = new Log();
// logger.info("Loop 2 " + String.valueOf(baos.size()));
log.setHostname("had" + i + ".sc9.admob.int");
log.setTimestamp("332423");
log.setName("dmJob300");
log.setValue("Log line as following: random string " + generator.nextInt());
log.setError("line explaining error 2");
log.setStatus(2);
out.writeObject(log);
out.flush();
// Send message to rabbit
MessageManager.getInstance().publishMessage(baos.toByteArray(), rabbitExchange);