[rules-users] How to start with Drools Fusion as a Java enterprise newbie

Jeremy Ary jeremy.ary at gmail.com
Fri Jan 18 10:15:00 EST 2013


For another perspective, I can offer up one of my playgrounds that I was
using to work out a problem not long ago. It closely fits a model I've used
for integration in the past and is using Fusion. I also use the Spring
framework, as it just simplifies life at this level of integration. It's
not perfect, but does have some abstractions and best practices I've formed
over the last few years. It's in Groovy and uses Gradle, but I think you'll
be able to bridge the gap if you've done much with Java.

https://github.com/jeremyary/CEP_dynamicFactRetraction

- jary


On Fri, Jan 18, 2013 at 9:06 AM, Stephen Masters <stephen.masters at me.com>wrote:

> I should warn you that it's a work in progress and the current version has
> very little Drools related code in it. Most of the Drools code is actually
> in the tests, where I have been prototyping things. The current piece of
> code in there is a validator which might as well be a stateless session,
> but I'm also putting some code for a streaming trade aggregator into it. I
> have it in another side project at the moment, so it should hopefully be
> quick to add it this weekend. It's not using the time window queries of
> Fusion, but it is using a single session in stream mode, so that events can
> be inserted as they occur.
>
> However, hopefully for now it provides a reasonable example of a web
> project structure and build, with Drools components. Keep an eye on the
> project over the next few days for some more meat on the bones! :)
>
> Steve
>
>
> On 18 Jan 2013, at 14:14, Thomas Söhngen <thomas.soehngen at stockpulse.de>
> wrote:
>
>  Hi Steven,
>
> thank you very much for the code example, I'll take a deeper look at it.
> Are you using Fusion too?
>
> For our Drools project we need minimal logic for the application itself.
> We just need a database of rules and need to send streams of events to
> Fusion. When rules are matched, a message should be send to a pub/sub
> channel. This is all the logic we need for our application.
>
> We are currently not using any "classic" Java framework (like Spring
> etc.), but we are using a specialized framework for distributed realtime
> computation (Storm). I have no experience with the classic application
> frameworks and thats my biggest problem atm, because it's hard for me to
> find a good way to start with Drools without any EE application background.
> Your example seems to be a good starting point for this, so thank you again
> :)
>
> Best regards,
> Thomas
>
> Am 1/18/2013 11:44 AM, schrieb Stephen Masters:
>
> Hi Thomas,
>
>  I don't know what frameworks you were thinking of using, but this might
> be a reasonable basic example of a Java web application with Drools
> components:
> https://github.com/gratiartis/sctrcd-fx-web
>
>  It's something I have been knocking up as a minimal example project. As
> such, it's a work in progress, and the Drools functionality is *very*
> minimal. I'm just at the stage where I'm looking to make that part of the
> projects a little bit richer.
>
>  It's built on Maven and the Spring Framework. As such you should be able
> to cd into the root of the project and run "mvm jetty:run" to run it up in
> a web container.
>
>  My tip for getting your project up and running initially would be to
> ignore JBoss AS for now, and run your project up on Tomcat. It should
> reduce the complexity of your deployment, so you can concentrate on your
> application instead. At a later stage, you may find it worth moving to
> JBoss AS as your application server, in which case your app would be
> running up inside Tomcat anyway, so if your app works under Tomcat, there
> should be little or no change to migrate to JBoss AS.
>
>  For your local dev purposes, this has the added benefit that maven can
> spawn a Tomcat container on the fly, so you don;t need to worry too much
> about server config.
>
>  Steve
>
>
>  On 17 Jan 2013, at 10:59, Thomas Söhngen <thomas.soehngen at stockpulse.de>
> wrote:
>
>  Hi,
>  I am currently evaluating Drools for our needs, from the features it
> seems to be a perfect fit. I am a Java developer, but unfortunately I have
> no background in enterprise application servers and I am currently stuck
> trying to setup a testing environment. A short summary of our current setup
> and how we want to use Drools:
>
>    - We are using Storm <https://github.com/nathanmarz/storm> to
>    accumulate a large number of messages from around the web
>    - From these we create streams of message metadata (like sentiment)
>    for different topics (like stocks)
>    - We have additional streams like stock-tickers
>    - We have a knowledge-base of additional facts about companies (like
>    market cap.) in MySQL
>    - We want users to be able to define alerts triggered by rules based
>    on these streams and facts
>
> Storm is perfect for the data pre-processing and aggregation, Drools would
> fit in to allow outsiders to define rules and evaluate them on the streams
> in realtime. My idea is, to run Drools Fusion as a stand-alone application
> on a dedicated server or cluster of servers. Drools Guvnor would be used as
> an interface for the rules. The rules would trigger new events, which would
> be sent to a subscription channel (like Redis Pub/Sub).
>
> As mentioned above, I have no experience in setting up and running Java
> application servers. The Drools documentation seems to be very elaborate,
> but assume that you know how to start such a service from scratch, which I
> don't. I know Java, but not at an enterprise level, so all the Beans, wars,
> etc. are new to me. I setup a JBoss AS, which was a pretty easy thing to
> do, but I am clueless about how to really "run" Drools on it and what to do
> next.
>
> So what would be the next steps to get a server, where I can send messages
> to? Are there any tutorials or guidelines which describe how to built such
> a thing from the very beginning? Any help or suggestion would be very
> appreciated!
>
> Regards & thanks in advance,
> Thomas Söhngen
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> _______________________________________________
> rules-users mailing listrules-users at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> --
> Thomas Söhngen
>
> Office: +49 221 294 975 20
> Email: thomas.soehngen at stockpulse.de
> www.stockpulse.dewww.facebook.com/stockpulse
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> StockPulse UG (haftungsbeschränkt)
> Sitz der Gesellschaft: Köln
> Amtsgericht: Köln (HRB 145359)
> Vertretungsberechtige Geschäftsführer: Stefan Nann, Jonas Krauss
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> StockPulse UG (Limited Liability)
> Registered Office: Cologne
> District Court: Cologne HRB (145359)
> Managing Director: Stefan Nann, Jonas Krauss
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>  _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130118/34fb9766/attachment.html 


More information about the rules-users mailing list