try {
{ // setup the sender client ...
sender = glob.getXmlBlasterAccess();
ConnectQos qos = new ConnectQos(sender.getGlobal(), senderName, "secret");
ConnectReturnQos conRetQos = sender.connect(qos, new I_Callback() {
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
log.info("Receiving asynchronous message '" + updateKey.getOid() + "' in sender default handler" );
log.info("Received: " + updateKey.toXml() + "\n <content>" + new String(content) + "</content>" + updateQos.toXml());
return "";
}
}); // Login to xmlBlaster, default handler for updates
log.info("Sender connected to xmlBlaster " + conRetQos.getSessionName().getRelativeName());
}
{ // setup the receiver client ...
Global globReceiver = glob.getClone(null);
receiver = globReceiver.getXmlBlasterAccess();
ConnectQos qos = new ConnectQos(receiver.getGlobal(), receiverName, "secret");
ConnectReturnQos conRetQos = receiver.connect(qos, new I_Callback() {
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
log.info("Receiving asynchronous message '" + updateKey.getOid() + "' in receiver default handler");
log.info("Received: " + updateKey.toXml() + "\n <content>" + new String(content) + "</content>" + updateQos.toXml());