Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.PublishReturnQos.toXml()


         log.warning("XmlBlasterException: " + e.getMessage());
         assertTrue("publish - XmlBlasterException: " + e.getMessage(), false);
      }

      assertTrue("returned publishOid == null", publishOid != null);
      assertTrue("returned publishOid: " + publishReturnQos.toXml(), 0 != publishOid.length());
   }

   /**
    * TEST: subscribe and unSubscribe on an empty topic (without a publish)
    * The unSubscribe is done with an oid instead of a subId
View Full Code Here


               try {
                  for (int i=0; i<entries.length; i++) {
                     if (MethodName.PUBLISH.equals(entries[i].getMethodName())) {
                        MsgUnit msg = entries[i].getMsgUnit();
                        PublishReturnQos retQos = (PublishReturnQos)entries[i].getReturnObj();
                        log.info("Send asynchronously message '" + msg.getKeyOid() + "' from queue: " + retQos.toXml());
                     }
                     else
                        log.info("Send asynchronously " + entries[i].getMethodName() + " message from queue");
                  }
               } catch (Throwable e) {
View Full Code Here

               log.info("#" + (i+1) + "/" + numPublish +
                         ": Published oneway message '" + msgUnit.getKeyOid() + "'");
            }
            else {
               PublishReturnQos prq = con.publish(msgUnit);
               if (log.isLoggable(Level.FINEST)) log.finest("Returned: " + prq.toXml());

               log.info("#" + currCounter + "/" + numPublish +
                         ": Got status='" + prq.getState() +
                         (prq.getData().hasStateInfo()?"' '" + prq.getStateInfo():"") +
                         "' rcvTimestamp=" + prq.getRcvTimestamp() +
View Full Code Here

               try {
                  for (int i=0; i<entries.length; i++) {
                     if (MethodName.PUBLISH.equals(entries[i].getMethodName())) {
                        MsgUnit msg = entries[i].getMsgUnit();
                        PublishReturnQos retQos = (PublishReturnQos)entries[i].getReturnObj();
                        log.info("Send asynchronously message '" + msg.getKeyOid() + "' from queue: " + retQos.toXml());
                     }
                     else
                        log.info("Send asynchronously " + entries[i].getMethodName() + " message from queue");
                  }
               } catch (Throwable e) {
View Full Code Here

            if (this.msgUnitCb != null) {
               this.msgUnitCb.intercept(msgUnit);
            }
            if (log.isLoggable(Level.FINE)) XmlScriptClient.log.fine("appendEndOfElement publish: " + msgUnit.toXml());
            PublishReturnQos ret = this.access.publish(msgUnit);
            writeResponse(methodName, (ret != null)?ret.toXml("  "):null);
            return true;
         }
         if (MethodName.PUBLISH_ARR.equals(methodName)) {
            int size = this.messageList.size();
            MsgUnit[] msgs = new MsgUnit[size];
View Full Code Here

            this.access.publishOneway(msgs);
            return true;
         }
         if (MethodName.SUBSCRIBE.equals(methodName)) {
            SubscribeReturnQos ret = this.access.subscribe(this.key.toString(), this.qos.toString());
            writeResponse(methodName, ret.toXml("    "));
            return true;
         }
         if (MethodName.UNSUBSCRIBE.equals(methodName)) {
            UnSubscribeReturnQos[] ret = this.access.unSubscribe(this.key.toString(), this.qos.toString());
            String[] retStr = new String[ret.length];
View Full Code Here

                              throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, txt);
                           }
                           I_Checkpoint cp = glob.getCheckpointPlugin();
                           if (cp != null)
                              cp.passingBy(I_Checkpoint.CP_PUBLISH_ACK, msgUnit, null, null);
                           return publishReturnQos.toXml();
                        }
                        /*
                        if (publishReturnQos != null) {
                           // Message was forwarded. TODO: How to return multiple publishReturnQos from multiple destinations? !!!
                           BUGGY: We need to take a clone to not remove the destination of the sent message
View Full Code Here

                            if (cp != null)
                               cp.passingBy(I_Checkpoint.CP_PUBLISH_ACK, msgUnit, null, null);
                           publishReturnQos = ret.getPublishReturnQos();
                           if (ret.getNodeMasterInfo().isDirtyRead() == false) {
                              if (log.isLoggable(Level.FINE)) log.fine("Message " + msgKeyData.getOid() + " forwarded to master " + ret.getNodeMasterInfo().getId() + ", dirtyRead==false nothing more to do");
                              return publishReturnQos.toXml();
                           }
                           // else we publish it locally as well (dirty read!)
                        }
                     }
                     catch (XmlBlasterException e) {
View Full Code Here

            I_Checkpoint cp = glob.getCheckpointPlugin();
            if (cp != null)
               cp.passingBy(I_Checkpoint.CP_PUBLISH_ACK, msgUnit, null, null);
         }

         return publishReturnQos.toXml(); // Use the return value of the cluster master node
      }
      catch (XmlBlasterException e) {
         if (log.isLoggable(Level.FINE)) log.fine("Throwing exception in publish: " + e.toXml()); // Remove again
         throw e;
      }
View Full Code Here

      try {
         MsgUnit msgUnit = new MsgUnit(glob, xmlKey, content, qos);
         StopWatch stop = new StopWatch();
         PublishReturnQos publish = senderConnection.publish(msgUnit);
         log.info("Success: Publishing done: " + publish.toXml() + "\n" + stop.nice());
         //log.info(ME, "Success: Publishing done, returned message oid=" + publish.getKeyOid() + stop.nice());
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
      }
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.