Examples of HistoryQueueProperty


Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

               TopicProperty topicProperty = new TopicProperty(glob);
               topicProperty.setDestroyDelay(destroyDelay);
               topicProperty.setCreateDomEntry(createDomEntry);
               topicProperty.setReadonly(readonly);
               if (historyMaxMsg >= 0L) {
                  HistoryQueueProperty prop = new HistoryQueueProperty(this.glob, null);
                  prop.setMaxEntries(historyMaxMsg);
                  topicProperty.setHistoryQueueProperty(prop);
               }
               if (consumableQueue)
                  topicProperty.setMsgDistributor("ConsumableQueue,1.0");
               pq.setTopicProperty(topicProperty);
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

         report.append("msgUnitStore: 'currentMaxEntriesCache='" + currentMaxEntriesCache + "' > than what publish proposed: '" + msgUnitStoreProps.getMaxEntriesCache() + "' will leave it to '" + currentMaxEntriesCache + "'\n");
         msgUnitStoreProps.setMaxEntriesCache(currentMaxEntriesCache);
      }
      log.info("new msgUnitStore Props: " + msgUnitStoreProps.toXml());

      HistoryQueueProperty historyProps = topicProps.getHistoryQueueProperty();
      if (historyProps != null) {
         HistoryQueueProperty currentHistoryProps = this.topicProperty.getHistoryQueueProperty();
         currentMaxBytes = currentHistoryProps.getMaxBytes();
         currentMaxBytesCache = currentHistoryProps.getMaxBytesCache();
         currentMaxEntries = currentHistoryProps.getMaxEntries();
         currentMaxEntriesCache = currentHistoryProps.getMaxEntriesCache();
         if (!historyProps.getMaxBytesProp().isSet() && currentMaxBytes > historyProps.getMaxBytes()) {
            report.append("history: 'currentMaxBytes='" + currentMaxBytes + "' > than what publish proposed: '" + historyProps.getMaxBytes() + "' will leave it to '" + currentMaxBytes + "'\n");
            historyProps.setMaxBytes(currentMaxBytes);
         }
         if (!historyProps.getMaxBytesCacheProp().isSet() && currentMaxBytesCache > historyProps.getMaxBytesCache()) {
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

         assertEquals("", 4L, cache.getMaxEntries());
         assertEquals("", 40L, cache.getMaxBytes());
         assertEquals("", "deadMessage", cache.getOnOverflow());

         assertEquals("", true, topicProperty.hasHistoryQueueProperty());
         HistoryQueueProperty hist = topicProperty.getHistoryQueueProperty();
         assertEquals("", "history", hist.getRelating());
         assertEquals("", "HI", hist.getType());
         assertEquals("", "2.0", hist.getVersion());
         assertEquals("", 3L, hist.getMaxEntries());
         assertEquals("", 30L, hist.getMaxBytes());
         assertEquals("", "deadMessage", hist.getOnOverflow());
      }
      catch (XmlBlasterException e) {
         fail("testToXml failed: " + e.toString());
      }
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

                      "</key>";
      String content = "" + counter;
      PublishQos qosWrapper = new PublishQos(glob); // == "<qos></qos>"
      if (numHistory > -1) {
         TopicProperty topicProp = new TopicProperty(this.glob);
         HistoryQueueProperty historyQueueProp = topicProp.getHistoryQueueProperty();
         historyQueueProp.setMaxEntries(numHistory);
         // TODO TEST THE maxEntriesCache != entriesCache. First specify the required behaviour.
         historyQueueProp.setMaxEntriesCache(numHistory);
         qosWrapper.setTopicProperty(topicProp);              
      }
     
      MsgUnit msgUnit = new MsgUnit(xmlKey, content.getBytes(), qosWrapper.toXml());
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

            PublishQos publishQos = new PublishQos(engineGlob);
            publishQos.setLifeTime(-1L);
            publishQos.setForceUpdate(true);
            // TODO: Configure history depth to 0 only on first publish
            TopicProperty topicProperty = new TopicProperty(engineGlob);
            HistoryQueueProperty historyQueueProperty = new HistoryQueueProperty(engineGlob, engineGlob.getId());
            historyQueueProperty.setMaxEntriesCache(2);
            historyQueueProperty.setMaxEntries(2);
            topicProperty.setHistoryQueueProperty(historyQueueProperty);
            publishQos.setTopicProperty(topicProperty);
            msgQosData = publishQos.getData();
         }
         if (summary != null && summary.length() > 0)
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

   /**
    * @return the configuration of the history queue, is never null
    */
   public HistoryQueueProperty getHistoryQueueProperty() {
      if (this.historyQueueProperty == null) {
         this.historyQueueProperty = new HistoryQueueProperty(glob, glob.getStrippedId());
      }
      return this.historyQueueProperty;
   }
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

      org.xmlBlaster.client.qos.PublishQos publishQos = new org.xmlBlaster.client.qos.PublishQos(glob);
      publishQos.setLifeTime(-1L);
      publishQos.setForceUpdate(true);

      TopicProperty topicProperty = new TopicProperty(glob);
      HistoryQueueProperty historyQueueProperty = new HistoryQueueProperty(glob, glob.getId());
      historyQueueProperty.setMaxEntriesCache(2);
      historyQueueProperty.setMaxEntries(2);
      topicProperty.setHistoryQueueProperty(historyQueueProperty);
      publishQos.setTopicProperty(topicProperty);
      this.publishQosForEvents = publishQos;

      // Should we configure historyQueue and msgUnitStore to be RAM based only?
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

            this.topicStore = glob.getStoragePluginManager().getPlugin(type, version, topicStoreId, topicStoreProperty);
            //this.topicStore = new org.xmlBlaster.engine.msgstore.ram.MapPlugin();
            log.info("Activated storage '" + this.topicStore.getStorageId() + "' for persistent topics, found " + this.topicStore.getNumOfEntries() + " topics to recover.");

            MsgUnitStoreProperty limitM = new MsgUnitStoreProperty(glob, null); // The current limit from xmlBlaster.properties
            HistoryQueueProperty limitH = new HistoryQueueProperty(glob, null); // The current limit
            I_MapEntry[] mapEntryArr = this.topicStore.getAll(null);
            boolean fromPersistenceStore = true;
            for(int i=0; i<mapEntryArr.length; i++) {
               TopicEntry topicEntry = (TopicEntry)mapEntryArr[i];
               PublishQosServer publishQosServer = new PublishQosServer(glob,
                       (MsgQosData)topicEntry.getMsgUnit().getQosData(), fromPersistenceStore);
               publishQosServer.setTopicEntry(topicEntry); // Misuse PublishQosServer to transport the topicEntry
               boolean existsAlready = (glob.getTopicAccessor().accessDirtyRead(topicEntry.getKeyOid()) != null);
               if (existsAlready) {
                  log.warning("Removing duplicate of topic '" + topicEntry.getLogId() + "' from persistence store");
                  try {
                     this.topicStore.remove(topicEntry);
                  }
                  catch (XmlBlasterException e) {
                     log.severe("Removing duplicate of topic '" + topicEntry.getLogId() + "' from persistence store makes problems: " + e.getMessage());
                  }
                  continue;
               }
               try {
                  // Check limits
                  TopicProperty topicProps = ((MsgQosData)topicEntry.getMsgUnit().getQosData()).getTopicProperty();
                  if (topicProps != null && topicProps.getMsgUnitStoreProperty() != null) {
                     MsgUnitStoreProperty p = topicProps.getMsgUnitStoreProperty();
                     if (p.getMaxBytes() > limitM.getMaxBytes()) { // How to prevent a smaller limit than actual bytes on HD?
                        p.setMaxBytes(limitM.getMaxBytes());
                     }
                     if (p.getMaxBytesCache() > limitM.getMaxBytesCache()) {
                        p.setMaxBytesCache(limitM.getMaxBytesCache());
                     }
                     if (p.getMaxEntries() > limitM.getMaxEntries()) { // How to prevent a smaller limit than actual entries on HD?
                        p.setMaxEntries(limitM.getMaxEntries());
                     }
                     if (p.getMaxEntriesCache() > limitM.getMaxEntriesCache()) {
                        p.setMaxEntriesCache(limitM.getMaxEntriesCache());
                     }
                  }

                  if (topicProps != null && topicProps.getHistoryQueueProperty() != null) {
                     HistoryQueueProperty h = topicProps.getHistoryQueueProperty();
                     if (h.getMaxBytes() > limitH.getMaxBytes()) {
                        h.setMaxBytes(limitH.getMaxBytes());
                     }
                     if (h.getMaxBytesCache() > limitH.getMaxBytesCache()) {
                        h.setMaxBytesCache(limitH.getMaxBytesCache());
                     }
                     if (h.getMaxEntries() > limitH.getMaxEntries()) {
                        h.setMaxEntries(limitH.getMaxEntries());
                     }
                     if (h.getMaxEntriesCache() > limitH.getMaxEntriesCache()) {
                        h.setMaxEntriesCache(limitH.getMaxEntriesCache());
                     }
                  }


                  publish(unsecureSessionInfo, topicEntry.getMsgUnit(), publishQosServer);
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

      topicProperty.setDestroyDelay(destroyDelay);
      topicProperty.setCreateDomEntry(false);
      topicProperty.setReadonly(false);
      pq.setAdministrative(true);
      if (historyMaxMsg >= 0L) {
         HistoryQueueProperty prop = new HistoryQueueProperty(this.glob, null);
         prop.setMaxEntries(historyMaxMsg);
         topicProperty.setHistoryQueueProperty(prop);
      }
      pq.setTopicProperty(topicProperty);
      MsgUnit msgUnit = new MsgUnit(pk, new byte[0], pq);
      PublishReturnQos prq = publish(msgUnit);
View Full Code Here

Examples of org.xmlBlaster.util.qos.storage.HistoryQueueProperty

                  MsgUnitStoreProperty tmpProp = new MsgUnitStoreProperty(glob, glob.getId());
                  tmpProp.startElement(uri, localName, name, attrs);
                  msgQosData.getTopicProperty().setMsgUnitStoreProperty(tmpProp);
               }
               else { // assuming related="history"
                  HistoryQueueProperty tmpProp = new HistoryQueueProperty(glob, glob.getId());
                  tmpProp.startElement(uri, localName, name, attrs);
                  msgQosData.getTopicProperty().setHistoryQueueProperty(tmpProp);
               }
               return;
            }

            log.warning("Found queue tag but don't know how to handle it: " + xmlLiteral);
         }
         return;
      }

      if (name.equalsIgnoreCase("persistence")) {
         if (!inQos)
            return;
//       this.inPersistence = true;
         if (attrs != null) {
            if (inTopic) {
               MsgUnitStoreProperty tmpProp = new MsgUnitStoreProperty(glob, glob.getId());
               tmpProp.startElement(uri, localName, name, attrs);
               msgQosData.getTopicProperty().setMsgUnitStoreProperty(tmpProp);
               return;
            }

            log.warning("Found msgUnitStore tag but don't know how to handle it: " + xmlLiteral);
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.