stock.setValue(stock.getValue() + change);
} else {
stock.setValue(stock.getValue() - change);
}
Channel ch = b.getChannel("/stock/"+stock.getSymbol(), true);
Message m = b.newMessage(c);
m.put("stock", stock.toString());
m.put("symbol", stock.getSymbol());
m.put("price", stock.getValueAsString());
m.put("change", stock.getLastChangeAsString());
ch.publish(m);
System.out.println("Bayeux Stock: "+stock.getSymbol()+" Price: "+stock.getValueAsString()+" Change: "+stock.getLastChangeAsString());
}
Thread.sleep(850);
}