Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 86626 invoked from network); 6 Dec 2007 17:51:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2007 17:51:05 -0000 Received: (qmail 22107 invoked by uid 500); 6 Dec 2007 17:50:54 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 21781 invoked by uid 500); 6 Dec 2007 17:50:53 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 21772 invoked by uid 99); 6 Dec 2007 17:50:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 09:50:53 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 64.233.184.230 as permitted sender) Received: from [64.233.184.230] (HELO wr-out-0506.google.com) (64.233.184.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 17:50:30 +0000 Received: by wr-out-0506.google.com with SMTP id 71so294059wri for ; Thu, 06 Dec 2007 09:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=y3dlKU2eMZzDK8JTVtVfc9b8jNU1xiinCgClBXhj4Fw=; b=xMNVgisjkJ9jYd6e7eGjWah1RO5c2aS1SHanQmgCf7O0Mo4oQUFK7JcilsXQy0jdBektqBzt8F4sMinKhFN8zojthH0J3TVDYenFTg9ZSpMFiUF1N72X5LcC61J224uD2jB0AoKIo+Pzhw6rIX3lTFLlf0tjyvZLd+xzFyQqyc0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QlmAnXvQ7eu/wMlESEu2rM1Zi9xhmAomLNkncLhN4BgLga/d0G8KF501BkbiqvDlLKamFDfDt/mcssZQvg7o42G2ZUrhcMIm61cIM+GnDVWBTaOmWFMwg8BsQN5eEJThXoLg7f9ZxCohcY4ngxKfY76Sre4UWQTISnSSPIHi5bE= Received: by 10.150.201.13 with SMTP id y13mr131717ybf.1196963432275; Thu, 06 Dec 2007 09:50:32 -0800 (PST) Received: by 10.150.149.6 with HTTP; Thu, 6 Dec 2007 09:50:32 -0800 (PST) Message-ID: Date: Thu, 6 Dec 2007 17:50:32 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Reload Java EIP Rules In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13834840.post@talk.nabble.com> <13839275.post@talk.nabble.com> <13850813.post@talk.nabble.com> <00EEE2CF-AA09-4A7A-8A82-09DF2A16A281@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 20/11/2007, James Strachan wrote: > On 20/11/2007, James Strachan wrote: > > On 20/11/2007, Rob Davies wrote: > > > ActiveMQ 5 requires Java 5 - so this won't be a problem for AgentSmth > > > We just need to override the Smith.redefineClass() method in a > > > derived class to add some eventing to stop the routes and reload the > > > classes > > > > That should work! :) > > > > If it doesn't - or we hit some limitation of AgentSmith (e.g. I've > > seen talk of AgentSmith not reloading stuff if you add new methods or > > fields to a class), I guess we could always build our own little > > reloading classloader thingy? > > > > e.g. we could do something like this in camel... > > > > > > > > > > > > which would then create a single ClassLoader for all the *.jar files > > in that directory and then load and activate all the rules in there. > > > > If any of the jars change, we could stop all those rules, ditch the > > classloader and reload all the jars again and re-activate the rules > > again. > > > > I guess AgentSmith might be more clever and realise just which rules > > have actually changed maybe? I wonder if eclipse has any clever > > hot-swap ninja we could reuse? > > I was chatting with Guillaume on IRC and he mentioned this lovely > looking tool... > http://www.aqute.biz/Code/FileInstall > > which can monitor a directory for OSGi bundles (jars really) and > install+start then stop+uninstall & reload things if the jars change. > > So I guess one neat solution could be to allow ActiveMQ to boot up an > OSGi container (say Felix) with spring+osgi and FileInstall installed. > Then if Java routing rules were put into OSGi bundles (i.e. a jar with > the OSGi metadata), spring-osgi should auto-boot up the bundle and > activate the routing rules when the jar loads - and stop the routing > rules when the bundle is stopped & uninstalled. > > It'd be nice if we could get the FileInstall to also allow any > spring.xml to be added to the deploy directory & for it to be > reloaded; then folks could just drop in routing rules as spring.xml > files; or edit them to have things reload. i.e. kinda treating any > spring.xml file as a kinda bundle with no Java code :) Just to tie up the loose ends here - the ServiceMix 4 Runtime is coming together nicely! It supports the hot-redeployment of OSGi bundles; so Camel routes get auto-redeployed. Plus there's an expanded OSGi bundle format; so you can edit a Spring XML or change a Java class inside a bundle (via just editing the files directly) and the runtime will auto-reload the OSGi bundle giving fast reload of any Camel routing rules. http://cwiki.apache.org/SMX4/runtime.html So the only thing we need is to convert the ActiveMQ broker itself to use the ServiceMix 4 Runtime to deploy/run itself and we're good to go. -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com