Can I call JET.news.create().more() more than one times?

I create a subscription like below: var newsSubscription = JET.News.create() .newsExpression("IBM.N") .topSize(0) .basketSize(1) .onAppend(onAppendAll) //.onInsert(onInsertAll) // I don't need latest news but historical ones //.onDelete(onDeleteAll) .start(); And call the "more()" function like newsSubscription.more(1); And in the onAppendAll function, I calculate out a number to see whether more historical news needed. If yes, call "newsSubscription.more(1);" again, which will trigger onAppendAll again. The loop continues, until I find the news I want. This loop worked fine for some cases, until today I noticed a dead loop in Beta env. The same (unwanted) piece of news "urn:newsml:
reuters.com:20141014:nDJJN01A50:2" continues to return (after around 20 rounds of correct callings) by newsSubscription.more(1), which caused the dead loop. So, I tried to call the "more()" for once with bigger lines, like "newsSubscription.more(30)". And this time, everything returns well, and more news happening earlier than "urn:newsml:
reuters.com:20141014:nDJJN01A50:2" can be returned successfully (which means there are news older than that). So, my question is, can I call the "more()" functions many times? If nope, how to retrieve the latest piece of news I want in "history"? Thanks.

Answers

  • Refer to JET.js API Demo (News Plugin -> Retrieving more headlines at runtime), subscribtion.more() can be called multiple times. I got the same problem when using your snippet code but my app stuck at this headline: Append: 29-Oct-2014 : 08:00:59 Fitch Solutions: IBM's CDS Reach Widest Level in 3 Years
    IBM.N urn:newsml:
    reuters.com:20141029:nFit809685:1 I will contact JET team to verify the problem.
  • Thanks for looking into this.
  • I got the response back from the JET News team that they suggested to request at least 5 more headlines to avoid this issue.
  • Thanks. Will change my codes correspondingly.
  • I got another advice from the development team. Using a small number in more() will generate a lot of request and may impact the performance of the news database as well as generate a high network traffic.

    They suggest to request a minimum of 20 headlines.