Re: [rules-users] fire a rule only once (for the time being)
been thinking about this a lot. I know the real solution is to use logical inserts but I'm wondering how it would work in my case. The problem is that I may have several users with similar rules. Again, its a financial app so if a user wants to know if a price breaks a certain threshold, say low for the day, ideally when that low is broken the fact should be removed. However if I do that, would other user's rules ever fire (assuming they are looking for the same criteria)? Would it be outrageous to create one session per user? Is this a lot of overhead? -- View this message in context: http://drools.46999.n3.nabble.com/fire-a-rule-only-once-for-the-time-being-tp4018887p4018966.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] fire a rule only once (for the time being)
It seems like there are many similar problems but I have not been able to find anything that addresses my issue exactly. I have a stock trading application, and I want to check if the price is out of a range (high,low) if the price goes below low, the problem is the rule keeps firing if the price keeps going lower, this creates too much noise and overhead. I thought maybe the no-loop and duration attributes would help but they didnt. I know I could check not(Fired()) and use insert fired but I believe that spans the entire session which I do not want either. Is there a way to say fire this rule if true once then wait a period of time before I check again. From what Ive read maybe agenda filters, but I am not sure if that is flexible enough. -- View this message in context: http://drools.46999.n3.nabble.com/fire-a-rule-only-once-for-the-time-being-tp4018887.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] looking for advice
actually I think I just answered my own question. Every computation that I do is based on either quotes or previous closing values. Using fusion greatly simplifies everything and (I'm pretty sure) solves my problems. Am I correct? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-looking-for-advice-tp3941853p3941953.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fusion appears to be working properly, but...
Thank you both, that helps a lot. So fusion really helps to just manage the lifetime of a fact? I am trying to migrate my hand coding trading and analysis application to drools. I think it will work fine for currencies, perhaps only 100 messages per second, but I am worried about equity options data which could be 100k+ messages a second. Do you guys have any tips or trick for dealing with that amount of data, like a messages per second to rule ratio? Granted I know that is arbitrary because its based on the rule complexity. But perhaps simple two - three line basic rules. Is it even possible to answer this? Are there any metrics on the capabilities of drools for high message, high rule count scenarios? Thanks again. Bobby -- View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-but-tp3420043p3421986.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fusion appears to be working properly, but...
ok bad example. Are there any metrics on drools performance that I could reference? -- View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-but-tp3420043p3422055.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Fusion appears to be working properly, but...
It seems like I have fusion working correctly, yet the rules are not firing. I have a quote object class Quote { private String symbol; private double bid; private double ask; //eclipse generated getters and setter } in my drl I have the following: import path.to.quote; declare entry-point Incoming Quotes @doc (incoming quotes) end declare Quote @role (event) //@expires(2s) end rule show something when FXQuote(symbol == EUR/USD, s:symbol) from entry-point Incoming Quotes then System.out.println(euro quote); end in my code I am inserting manually: quoteStream = ksession.getWorkingMemoryEntryPoint(Incoming Quotes); ... quoteStream.insert(quote); I have verified I am getting quote objects with symbol == EUR/USD yet the rule is not firing I only say that it *appears* that I have the stream set up properly because everything compiles and runs and in my log file I see the incoming quotes: org.drools.audit.event.ObjectLogEvent type1/type factId6/factId objectToStringcom.trendfx.fxlib.FXQuote@103ec0d/objectToString /org.drools.audit.event.ObjectLogEvent org.drools.audit.event.ObjectLogEvent type3/type factId2/factId objectToStringcom.trendfx.fxlib.FXQuote@145f918/objectToString /org.drools.audit.event.ObjectLogEvent org.drools.audit.event.ObjectLogEvent type3/type factId3/factId objectToStringcom.trendfx.fxlib.FXQuote@184843c/objectToString /org.drools.audit.event.ObjectLogEvent org.drools.audit.event.ObjectLogEvent type3/type factId5/factId objectToStringcom.trendfx.fxlib.FXQuote@1912b66/objectToString /org.drools.audit.event.ObjectLogEvent etc.. simple rule but no output, tried debugging but since I can only add breakpoints to RHS this doesnt really help me Thanks, Bobby -- View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-but-tp3420043p3420043.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fusion appears to be working properly, but...
i did not but I was under the impression that the fireallrules method was for expert an not fusion. So anytime I have an 'event' come in I must call this method? I see that it works now, but this seems inefficient to me, how does this differentiate fusion, if its just like expert in a loop? Thanks for the response, Bobby -- View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-but-tp3420043p3420143.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fusion appears to be working properly, but...
thanks for the response, that makes a little more sense. That is an issue because the whole idea of CEP is to process events as they happen. My next step is adding camel support so that I can consume the amqp feed without manually inserting into the session. I guess fireuntilhalt is my only option. But what does fire until halt do, is it just a continuous loop or is is smart enough to only process events when they come in? so what would happen if the event is given an expiration of say 2 seconds? if you were calling fireallrules in anything over a 2 second interval you would miss a lot. I do not really see the benefit of fusion then, seems like its redundant? I hope that I am missing something. -- View this message in context: http://drools.46999.n3.nabble.com/Fusion-appears-to-be-working-properly-but-tp3420043p3420701.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule limit
thanks for all of the responses, fun to read :) Sorry I thought it was pretty strait forward question. I would assume somehow the parser 'knows' how many rules are in a drl file I do not want an over ambitious user to just create rule after rule after rule (though I suppose he could technically do a lot even in one rule) rule a //1 when then end rule b //2 when then end rule c //3 when then end and so on... -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-rule-limit-tp3394660p3400312.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] best design pattern for fusion stream
I have a trading application that currently handles a fair amount of messages per second, generally in the thousands. Soon it will handle 10s and perhaps hundreds of thousands of messages. I have not done any load testing yet but while I am here I figured I should ask if there are any known limitations that I may run in to? Presently my trading app handles price quotes by consuming an amqp queue bound to a topic: try { q = quotes.poll(100, TimeUnit.MILLISECONDS); if (q != null) handleIncomingQuote(q); } catch ... I would like to use fusion so that I can get the code infrastructure done and then hopefully never have to deal with code again for writing my strategies, ideally all of that will be in the form of rules. So I am at a point where I need to learn the camel integration piece so that fusion will consume the amqp feed. However, and this is my question, general practice is not to immediately do any work on incoming message, currently I add to a LinkedBlockingQueue and then pick up from another thread (shown above). So should I even worry about the AMQP/Camel integration? It would seem to me that if fusion is acting on each event this could become an eventual bottleneck. I wonder if I would be better off manually inserting my incoming quotes into the entry point in the manner that I have above, essentially by replacing handleIncomingQuote(q) with EntryPoint.insert(q)? Or does the working memory handle the buffering for me? Looking at the Stream and Entry point doc I would say there is a chance but I am not certain. Thanks Bobby -- View this message in context: http://drools.46999.n3.nabble.com/best-design-pattern-for-fusion-stream-tp3401432p3401432.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule limit
is this something I missed in the doc or would you mind pointing me in the direction of how to accomplish this? thanks Bobby -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-rule-limit-tp3394660p3398077.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users