<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<HEAD><!-- Template generated by Exclaimer Template Editor on 12:40:12 Thursday, 7 February 2013 -->
<STYLE type=text/css>P.2ee1cc27-72fd-41ad-a721-72d082ea8444 {
        MARGIN: 0cm 0cm 0pt
}
LI.2ee1cc27-72fd-41ad-a721-72d082ea8444 {
        MARGIN: 0cm 0cm 0pt
}
DIV.2ee1cc27-72fd-41ad-a721-72d082ea8444 {
        MARGIN: 0cm 0cm 0pt
}
TABLE.2ee1cc27-72fd-41ad-a721-72d082ea8444Table {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta name="Generator" content="Microsoft Word 12 (filtered medium)" />
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</HEAD>
<BODY lang="EN-US" link="blue" vlink="purple">
<P>
<div class="WordSection1">
<p class="MsoNormal"><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Thanks Jeremy. Just finished watching your referenced video “Drools & Large Data Sets Workshop” – no doubt about it, people are explicitly using this pattern
(Pool,Queue,Delegate,Callback) w/in Drools to achieve higher concurrent “simultaneous fact arrival” transaction throughput, and scale. Especially appreciate your comment re: managing Runnables’ callbacks w/in the proposed framework… we indeed have to be careful
here, and will re-factor or design accordingly.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif">From:</span></b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif"> rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
<b>On Behalf Of </b>Jeremy Ary<br />
<b>Sent:</b> Thursday, February 07, 2013 12:08 PM<br />
<b>To:</b> Rules Users List<br />
<b>Subject:</b> Re: [rules-users] ambition = ThreadPoolExecutor delegating to KBPool(s) & KSPools(s)<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Yep, that all makes sense for the more elaborated context. Sounds like you're working with a model wherein you needn't concern yourself with relational logic between instances, so I think the value of splitting sessions over threads with
a multi-consumer queueing setup could allow you the opportunity to async your process with better throughput. What you and I propose differs only in high-availability and scalability of the input stream (potentially arising from throttling to a single instance
responsible for maintaining task scheduling and executor lifecycle), offering an ability to recover should you lose your application containing pooled tasks and allow for smaller pool sizes to maintain (pull only as needed/desired from queueing and adjust
that capacity on the fly for high-usage times such as first thing in the morning). <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Semi-related I just found a video about a large-scale operation that Alexandre Porcelli created that might be of some interest to you.
<a href="http://vimeo.com/27209589">http://vimeo.com/27209589</a><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My only other thoughts going into it is consider some different approaches for the scheduling mechanism given that, as I've had the unpleasure of discovering before, callbacks from runnables can be fun to keep up with of you're dependent
on them, so fire-and-forget vs. results synchronicity can make a difference in the mechanism you choose to maintain your tasks and pools.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<br />
Jeremy<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style=margin-bottom:12.0pt><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Feb 7, 2013 at 10:47 AM, Cotton, Ben <<a href="mailto:Ben.Cotton@morganstanley.com" target="_blank">Ben.Cotton@morganstanley.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Thanks for your response, Ary.</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D>It is much more about accommodating high-frequency and throughput. The rules are ZERO sensitive
to time and order – they are rendered 1x at start of day. They are exceedingly complicated, and there are lots of them … but once they are bound to a KB nothing changes about them for the whole day. When we put a fact on a KS.fireAllRules() task the rendered
decision is idempotent wrt to rules’ firing(s) order. </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Also, all arriving facts are immutable and all sessions are stateless, so we kind of have ignored
CEP (seeing it as more appropriate for a long-living ecosystem of continuously mutating facts).
</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Effectively, we want a “small, simple, safe, speedy” body of operations on “complex, cumbersome,
concurrently-arriving, constant” facts.</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif">From:</span></b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Jeremy Ary<br />
<b>Sent:</b> Thursday, February 07, 2013 11:32 AM<br />
<b>To:</b> Rules Users List<br />
<b>Subject:</b> Re: [rules-users] ambition = ThreadPoolExecutor delegating to KBPool(s) & KSPools(s)</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto> <o:p></o:p></p>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto>Are you in a place where your rules have become sensitive to time and order? If so, have you considered CEP? If it's less about that and more about getting the work done ASAP, you
could also investigate a messaging integration pattern to assist with all the pooling/throttling/queueing needs you've mentioned.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;margin-bottom:12.0pt> <o:p></o:p></p>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto>On Thu, Feb 7, 2013 at 10:04 AM, Cotton, Ben <<a href="mailto:Ben.Cotton@morganstanley.com" target="_blank">Ben.Cotton@morganstanley.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>Let’s say that a start-of-day, every day, we generate a giant 2,000+ rule .DRL, that we then use to construct into a
<b>single</b> run-time KnowledgeBase reference. We then construct a <b>single</b> run-time KnowledgeSession reference (also at start of day). Throughout the day, all day, facts “arrive” asynchronously into our expert system. When a fact “arrives”, we synchronously
place the fact onto our single KS and call .fireAllRules(), which in turn synchronously outputs answers that satisfy our “what’s the next step?” decision requirements.
</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>We have this working very well, but we have the ambition to achieve more. </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>We want to attempt to scale this solution to accommodate the high-frequency simultaneous “arrival” of many facts. We have at our disposal a 24xCPU
128 gb Linux-based compute resource (nice, right?) … so, ideally, we have the ambition to potentially accommodate the simultaneous arrival of 24 facts into our expert system.</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>Assuming that all of our 2,000+ rules are completely isolated (i.e. no rule i ever depends on any rule j, for all i,j) we want to consider building
(at start of day) a KSPool (size 24) , KBPool (size 24), and a ThreadPoolExecutor (size 24, backed by BlockingQueue). As facts arrive throughout the day, those that arrive simultaneously are Queue’d to the TPE, that then delegates the fact’s need for service
to a task Runnable, which in turn calls a KSPool[i].fireAllRules() (with isolation to KBPool[i]). In such a scheme, we would potentially be able to render decisions concurrently when facts arrive simultaneously ( capacity 24).</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>Is this design ambition common w/in current DROOLs use cases? Does the current (or future) DROOLS offering include any in-place capability to Pool
KS or Pool KB? If not, are there any potential DROOLs concerns or “gotchas” wrt to our pursuing this ambition (in a “let’s build this now!” prototype)?
</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt>As always, tremendous thanks to all in this community forum.</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><span style=font-size:16.0pt> </span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><b><span style=color:gray> </span></b><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><b><span style=color:gray>Ben D Cotton III</span></b><span style=font-size:9.0pt;color:gray><br />
Morgan Stanley & Co.<br />
OTC Derivatives Clearing Technology <br />
1221 AOTA Rockefeller Ctr - Flr 27<br />
New York, NY 10020<br />
<a href="tel:%28212%29762.9094" target="_blank">(212)762.9094</a><br />
<a href="mailto:ben.cotton@ms.com" target="_blank"><span style=color:gray>ben.cotton@ms.com</span></a>
</span><o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto> <o:p></o:p></p>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto> <o:p></o:p></p>
</div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;margin-bottom:12.0pt> <o:p></o:p></p>
<div class="MsoNormal" align="center" style=text-align:center>
<hr size="2" width="100%" align="center" />
</div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><br />
<span style=font-size:7.5pt;font-family:"Arial","sans-serif";color:gray>NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section
975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality
or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link:
<a href="http://www.morganstanley.com/disclaimers" target="_blank"><span style=color:gray>http://www.morganstanley.com/disclaimers</span></a> If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging
with Morgan Stanley you consent to the foregoing.</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto><br />
_______________________________________________<br />
rules-users mailing list<br />
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br />
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></p>
</div>
<p class="MsoNormal" style=mso-margin-top-alt:auto;mso-margin-bottom-alt:auto> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style=margin-bottom:12.0pt><o:p> </o:p></p>
<div class="MsoNormal" align="center" style=text-align:center>
<hr size="2" width="100%" align="center" />
</div>
<p class="MsoNormal"><br />
<span style=font-size:7.5pt;font-family:"Arial","sans-serif";color:gray>NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section
975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality
or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link:
<a href="http://www.morganstanley.com/disclaimers" target="_blank"><span style=color:gray>http://www.morganstanley.com/disclaimers</span></a> If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging
with Morgan Stanley you consent to the foregoing.</span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><br />
_______________________________________________<br />
rules-users mailing list<br />
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br />
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<BR /><BR />
<HR id=HR1 />
<BR /><SPAN style="FONT-FAMILY: Arial; COLOR: #808080; FONT-SIZE: 7.5pt">NOTICE:
Morgan Stanley is not acting as a municipal advisor and the opinions or views
contained herein are not intended to be, and do not constitute, advice within
the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer
Protection Act. If you have received this communication in error, please destroy
all electronic and paper copies and notify the sender immediately.
Mistransmission is not intended to waive confidentiality or privilege. Morgan
Stanley reserves the right, to the extent permitted under applicable law, to
monitor electronic communications. This message is subject to terms available at
the following link: <A style="FONT-FAMILY: Arial; COLOR: #808080; FONT-SIZE: 7.5pt" href="http://www.morganstanley.com/disclaimers">http://www.morganstanley.com/disclaimers</A>
If you cannot access these links, please notify us by reply message and we will
send the contents to you. By messaging with Morgan Stanley you consent to the
foregoing.</SPAN><BR />
<P></P>
<P></P></P></BODY>
</HTML>