log.info("Not connected to xmlBlaster, proceeding in fail save mode ...");
SubscribeKey sk = new SubscribeKey(glob, "Banking");
SubscribeQos sq = new SubscribeQos(glob);
SubscribeReturnQos sr1 = con.subscribe(sk, sq);
log.info("Subsrcibed with id " + sr1.getSubscriptionId());
sk = new SubscribeKey(glob, "HelloWorld6");
sq = new SubscribeQos(glob);
SubscribeReturnQos sr2 = con.subscribe(sk, sq, new I_Callback() {
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
if (updateKey.getOid().equals("HelloWorld6"))
log.info("Receiving asynchronous message '" + updateKey.getOid() +
"' state=" + updateQos.getState() + " in HelloWorld6 handler");
else
log.severe("Receiving unexpected asynchronous message '" + updateKey.getOid() +
"' with state '" + updateQos.getState() + "' in HelloWorld6 handler");
return "";
}
}); // subscribe with our specific update handler
log.info("Subsrcibed with id " + sr2.getSubscriptionId());
PublishKey pk = new PublishKey(glob, "HelloWorld6", "text/plain", "1.0");
PublishQos pq = new PublishQos(glob);
MsgUnit msgUnit = new MsgUnit(pk, "Hi".getBytes(), pq);