Tuesday, 14 October 2008

Liking the File language in Camel 1.5.0

Claus has a great write up on the new File language feature in Camel 1.5.0 - cool stuff! I'm really looking forward to the next release!
A favorite feature of mine in the next Apache Camel is a new feature to use file name patterns in the file component. What we have introduced is a new language, the file language, so you can leverage this feature anywhere in Camel where it uses Expressions, Languages etc. The file language currently support both the file and the FTP component as well.

As a lot of integrations is file based you need to be able to read (consume) or write (produce) files. Then you need to be able to specify file names. What's new in Camel 1.5.0 is that you can express this using patterns, for instance directly in the configuration of your endpoints. Prior you had to do this in Java code.

Simple example
Lets image you need to move consumed files into a backup folder after processing.

Now you can express this using the pattern: backup/${file:name}
Well then you need to use .bak as extension, and the pattern is:backup/${file:name}.bak

Okay next issue is that the backup folder should be grouped by dates using the yyyyMMdd pattern. Well the expression support thejava.text.SimpleDateFormat patterns also.
The pattern is:backup/${date:now:yyyyMMdd}/${file:name}.bak wherenow means current date. You can substitute this with different commands such as file for using the timestamp on the file instead.

Advanced example
In this sample you need to produce files (save) and you need to save the file using a generate unique filename. We use the divide and conquer pattern for this so you create a POJO class that generates the unique filename, then you as the developer have the full power how to do this. And then its very easy to unit test as its plain POJO that can be tested very easily with JUnit. Next step is to express this as a file pattern. As your POJO is a bean we use the bean langauge to invoke your pojo.

So the pattern is: myfile-${bean:myguidgenerator.generateid}.txt
Where 
myguidgenerator is the bean id of your POJO and generateidis the method name. You can omit the method name if there is no ambiguity which method Camel should invoke.

Camel routes
This feature is configurable directly in camel routing on your endpoints. So what we can do now is:

from("file://inbox?expression=
backup/${date:now:yyyyMMdd}/${file:name}.bak").to("bean:processFile");

The route will consume files and process the files in the processFile bean, that is a plain POJO class. After processing the files is moved (renamed) using the pattern in the expression. So the file is moved to the backup subfolder, for example: backup/20081014/report-october-2008.bak

More to come
Well there is a ton of new features and improvements in Camel 1.5.0. Check out the current release note.

Thursday, 9 October 2008

Using Guice as a JNDI provider

In many ways a Dependency Injection framework is a replacement for looking things up in a registry like JNDI; but sometimes having some kind of registry or JNDI provider can be useful such as if you want to work with JSR250/EJB3 or some legacy code which expects JNDI to be used - or you want to use JNDI as a kinda loosely coupled registry between completely different modules of your system.

I've hacked up a simple JNDI provider which just uses Guice to create all the objects; so you stick to pure Java code for writing your Guice Modules to depenency inject your objects together then have a little properties file to enable/disable/tweak things.

When looking at Guice through spring-tinted glasses the most glaring difference (apart from the lack of XML) tends to be the absence of the ApplicationContext and a registry where you can look things up by name. This JNDI provider provides a more standard alternative to the ApplicationContext, as JNDI is in the JDK and it kinda gives you that crutch to lean on until you figure out the guicier way of doing your dependency injection :). 

Tuesday, 7 October 2008

Adding support for @PostConstruct, @PreDestroy and @Resource to Guice

I do like guice as a Dependency Injection engine; I think it has a lot of promise; particularly if 2.0 is released soon :)

I still struggle sometimes, coming from a spring framework mindset, figuring out how to do some stuff. Though I love the @Provides support in trunk of Guice. Here's hoping 2.0 is out soon! :)

I've experimented recently adding support for ConstructorInterceptors into guice so you can add custom lifecycles like @PostContruct from JSR250/EJB3 or Spring's InitializingBean etc. 

I've also created a patch to support closing of singletons such as via @PreDestroy or spring's DisposableBean.

Slightly more wacky is a patch adding support for custom injection point annotations which allows you to easily support things like 
  • @Resource from JSR 250/EJB3
  • @PersistenceContext from JPA
  • the various JAX-RS annotations like @Context, @PathParam etc
  • WebBeans @In
  • Spring's @Autowire
  • Apache Camel's injection annotations like @EndpointInject or @Produce
Feedback greatly appreciated!

Enterprise Integration Designer preview

From Oisin's blog.

Thanks to Enterprise Integration Patterns, architects have a clear and succinct way to describe integration within complex systems. It certainly beats a lot of MS-Word documents and monster integration architecture diagrams. And, with Apache Camel, we’ve got an open source runtime that allows us to create routes by chaining EIPs together, using Spring XML or Java fluent builders. That’s fantastic, but EIPs are as much about sharing pictures as creating message routing graphs, and where are the pictures?  

We’ve made some tools that will allow you to load up Camel Spring XML files into Eclipse for visual inspection and editing. You can also create EIP diagrams in your Workbench and save them as Camel configurations. Finally, we’ve put in some debugging capabilities to allow you trace through the paths a message will take through your EIP graph.  

We are earnestly seeking feedback - check out the FUSE Integration Designer Preview page to download the Eclipse plugins, or check out the video links under the Training Videos at the bottom of the page.

Looks great! Feedback greatly appreciated


Monday, 29 September 2008

Using Camel with ServiceMix Kernel

Gert has a great post on ServiceMix Kernel and Camel showing how easy it is to take ServiceMix Kernel, install Camel into it and then deploy a route using a simple Spring XML file. Nice job Gert!

Thursday, 18 September 2008

Apache ServiceMix Kernel 1.0.0 released!

via Guillaume's post
Apache ServiceMix Kernel 1.0.0 has just been released.

Apache ServiceMix Kernel is a small OSGi based runtime which provides
a lightweight container onto which various bundles can be deployed.
Amongst the list of supported features, Apache ServiceMix Kernel supports:
  • hot deployment of OSGi bundles, exploded bundles or custom artifacts (spring xml configuration files support is provided)
  • services configuration stored as property files are monitored and provided as standard OSGi configurations
  • a centralized logging back end supported by Log4J, ServiceMix Kernel supports a number of different APIs (JDK 1.4, JCL, SLF4J, Avalon, Tomcat, OSGi)
  • provisioning of libraries or applications can be done using simple commands via simple xml descriptors
  • native OS integration as a service so that the lifecycle will be bound to your Operating System.
  • an extensible shell console to manage services, applications and libraries
  • operations on the console can be done remotely via a secured and encrypted channel
  • a security framework based on JAAS
  • new instances can be created using a single command line

This release, with the detailed release notes, is available at:
http://servicemix.apache.org/kernel/servicemix-kernel-100.html.


I'm particularly pleased to get the 1.0.0 release out; it makes it really easy to have hot-redeployable Camel routing rules - just edit your Spring XML when using the expanded bundle mode and ServiceMix will auto-redeploy your routing rules dynamically!

Tuesday, 9 September 2008

Whats new in ServiceMix 4 and Camel

Rod Biresch has posted a nice blog post about what's new in ServiceMix 4.x which is definitely worth a read! 

Also Claus Ibsen has added to the collection of tutorials on Camel, this time on using Axis with Camel. Nice work guys!

Monday, 1 September 2008

better stack traces in Java with log4j - including the jar file and version number!

When problems occur in open source software users tend to get stack traces. They often fire them off to some open source mailing list or forum asking for help; often without providing much in the way of detail. One of the first questions asked by support teams is often 'OK, what version are you using'.

Given that its possible to figure out the actual version being used of each class - either using the package information from the MANIFEST or by finding the jar the class came from, it seems logical to include the version information into a stack trace at the end of the line.

One day the JVM might actually do this for us :)

In the meantime, I've created a patch for log4j to add this feature; it appends an optional String to stack traces printed via log4j which includes the jar file name if it can be deduced plus the Java Package version the line of code comes from.

Here's an example...
org.apache.log4j.config.PropertySetterException: Hello
at org.apache.log4j.spi.ThrowableInformationTest.testStackTracePackageName(ThrowableInformationTest.java:306)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [1.5.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [1.5.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [1.5.0]
at java.lang.reflect.Method.invoke(Method.java:585) [1.5.0]
at junit.framework.TestCase.runTest(TestCase.java:154) [junit-3.8.1.jar]
at junit.framework.TestCase.runBare(TestCase.java:127) [junit-3.8.1.jar]
at junit.framework.TestResult$1.protect(TestResult.java:106) [junit-3.8.1.jar]
at junit.framework.TestResult.runProtected(TestResult.java:124) [junit-3.8.1.jar]
at junit.framework.TestResult.run(TestResult.java:109) [junit-3.8.1.jar]
at junit.framework.TestCase.run(TestCase.java:118) [junit-3.8.1.jar]
at junit.textui.TestRunner.doRun(TestRunner.java:116) [junit-3.8.1.jar]
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94) [idea_rt.jar]
at junit.textui.TestRunner.doRun(TestRunner.java:109) [junit-3.8.1.jar]
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22) [idea_rt.jar]
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118) [idea_rt.jar]
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) [idea_rt.jar]
So you can see what version of junit is being used (despite there being no manifest information) along with the JDK implementation version.
e.g.
at java.lang.reflect.Method.invoke(Method.java:585) [1.5.0]
means we found the package number but couldn't find the jar file but we found the implementation version of java.lang.reflect to be 1.5.0. Whereas
at junit.framework.TestCase.run(TestCase.java:118) [junit-3.8.1.jar]
means we found the jar file but the jar file has no manifest version information.

Am hoping one day this gets into some log4j release! You can find the patch here if you're interested.

Friday, 29 August 2008

am loving Beyond REST and the PIMP protocol

I really enjoyed reading Joshua Schachter's post beyond rest today - and particularly the comments. The basic idea is how to get a kinda publish/subscribe system to work on the web for processing real time updates to things like social sites at internet scale without introducing some really complex new protocol; but reusing the lovely RESTful web endpoints.

I posted a comment in the thread but figured it was quite big so figured I'd post it here too :)

I'm really liking the PIMP protocol and like Sam's strawman of using caching headers to implement it...

My suggestion is to think of this instead as another form of caching. All we really want is a header that tells the server that we are interested when a particular resource has been updated and how to tell us. The server can then either understand that header and acknowledge in the response that it will notify me. Here is my strawman:Request:
...
X-Cache-Callback:http://www.javarants.com/notify/joshua.schachter.org/atom.xml;SECRET
Response:
...
X-Cache-Callback: OK

Then if that resource is updated the service is expected to either HEAD the callback as a notification or POST the new contents of the resource, servers choice. You could later add semantics for merely updating the resource vs replacing it wholesale. I would also think about adding the ability for the server to specify a timeout after which you are free to poll again if you haven't heard anything on the assumption that sometimes the service may lose the state associated with your subscription.

Am thinking rather than returning OK the server returns the amount of time before the client has to re-issue the subscription to keep it alive. So the server can decide the maximum subscription time. Good PIMP servers (PIMPS :) might wanna make this quite long to reduce the polling overhead.

I also love the simplicity of the HEAD or POST to differentiate a notification of change to a notification-with-the-data.

I've long wanted a 'SUBSCRIBE' verb in HTTP for doing this kinda thing; but I think your cache-header approach is cleaner - as folks can either keep polling and/or subscribe for the update notification.

The nice thing too is that it allows easy migration to PIMP without introducing any overhead or new traffic; that clients continue to poll as normal - but they advertise themselves as being PIMP aware. Then eventually when one day the server becomes PIMP aware the clients receive their notifications (and then hopefully they scale back their polling :) - otherwise they can stick to polling.

Also webmasters can monitor their traffic looking for PIMP headers to know when it'll make sense to upgrade to PIMP. Not everyone is gonna need PIMP and it'll be a no brainer from looking at your logs to determine both when you've sufficient mass of PIMP enabled pollers along with knowing what the reduction in polling traffic upgrading to PIMP would save you.


I'm with Sam in the thinking of this as another form of caching. In implementing PIMP some folks might be able to create update notifications internally in their system when resources change to push out change messages into some kinda queue for posting to the callback URL. This would involve significant work for many sites though.

However it'll surely be pretty trivial to just install a PIMP-enabled caching web proxy inside your data centre in front of your servers - that does the usual cache thing, but also detects these extra PIMP cache headers and does a background poll of resources (respecting your existing cache & time to live headers) to detect changes both to update the cluster of front web caches (so non-PIMP pollers get more real time data) but also to drive the pushing of updates out to PIMP subscribers.

i.e. I can see this as a pretty easy upgrade to most web sites - folks just update their front end web proxies to a PIMP-enabled version and hey presto you can now support PIMP consumers. Am sure the web proxies could include an XMPP firehose too pretty easily for heavy hitters.

It should be pretty easy to hack the web proxies to do this I'd have thought? Even the problem thats been noted earlier in this thread - of trying to push updates to a URL endpoint might be slow, unresponsive or unavailable - the web proxies have to deal with already right in case a *local* server is borked.

Anyway - its a very interesting blog post and particularly the comments. Interesting stuff.

Thursday, 28 August 2008

Running Nexus with launchd on OS X

I've finally got Nexus running for maven builds to help boost the speed downloading and checking repos etc.

This gave me the excuse to finally take a quick look at using launchd which is the preferred OS X way to run daemons and services. First look it appears cool and much nicer than rc/init.d/xinit.d et al.

Here's a really simple always-run nexus script, sonatype.nexus.plist. Just drop it into your ~/Library/LaunchAgents/ directory and you should be good to go.

From the command line you can then do this if you want to boot it up straight away - but it should restart on reboot (which I'll test out next time I've gotta reboot :)
launchctl start sonatype.nexus
I did try get clever and wait for port 8081 to be used before booting up nexus but couldn't get it to work properly so figured just starting it up on boot was easier :)

Update: BTW the script is available under the Apache License 2.0 if anyone wants to copy it or include it in any distro of Nexus

Wednesday, 27 August 2008

Neat eclipse templates for working with the Java or Spring DSLs for Camel

If you're an Eclipse user who works with Camel you might be interested in the Eclipse templates that Jon has just created - nice work Jon!

Another great Camel tutorial from Claus

Claus has done it again with part 4 of his excellent Camel tutorial. Check it out if you are interested in Enterprise Integration Patterns or Camel

Thursday, 24 July 2008

Apache Camel 1.4.0 released with 261 new features, improvements and fixes

Claus beat me to it, so being lazy I'm just gonna quote his post :)
Just after 3½ months since release 1.3.0 of Apache Camel we have been very busy and have resolved 261 tickets.

Check out the release notes and go grab it from the download page.

If you are not familiar with Apache Camel then check out the FAQ or the Getting Started guide.

If you have more time and a fresh brew of coffee then I encourage you to read a somewhat different tutorial that focus on introducing Camel into an existing project step by step. The tutorial is work in progress, so check it out from time to time. The tutorial is based on a real life use-case.

If you have less time check out the regular tutorial that demonstrates how Camel easily work well together with Spring for message exchanges over JMS.

If you have questions about Camel then please check out the forums/mailinglists.

And then the answer to the mother of all questions about Camel.
There's tons of stuff in there. One of the most trivial changes to implement but one of my 'DOH why didn't we do that a long time ago' changes is the new tracer; very handy! Great work camel riders!

Incidentally its interesting to see how popular Camel is getting. For example looking at the Apache mailing list activity at nabble there's currently ActiveMQ in first place, ServiceMix in second and Camel doing a pretty respectable 7th behind Wicket, Maven, Struts and Lucene. Pretty good - particularly as its way above all of the Incubator projects combined (including a fair few that have graduated a while ago :), all Apache Web Services projects combined, Tomcat and Gerornimo etc

ActiveMQ, Camel and ServiceMix are doing pretty well in the Java software community rankings too

Monday, 23 June 2008

Are people blogging less?

Maybe its a bug with google reader or something but for the first time in ages my great and good folders of feeds I track (my kinda 2 tier way of keeping on top of blogs) are nearly empty. Do folks just twitter now or something?

Tuesday, 3 June 2008

TimeCapsule & TimeMachine saved my ass!

My MacBookPro died on me. It kinda kept freezing so I did a hard reboot then after that it wouldn't boot at all :) Took it to the Apple Store; they figured out it was some kinda disc corruption; so wiped the disk (after managing to restore the files I was hacking on, bless that genius at the bar), reinstalled Leopard and things are OK (the disk may be faulty, we'll see soon).

Luckily the TimeCapsule had all my stuff so I could use the Migration Assistant to restore my apps & user accounts from the backup on the Time Machine. The UI did freak me out a bit - when the thing started it kept saying 'connecting...' then hanging for ages. I kept thinking it wasn't working so trying all kinds of things. Turns out, its just wacky slow. The next screen shows the list of user accounts - again thats wacky slow - takes maybe an hour for a 100Gb backup to show the few user accounts in the backup!

The 2 massive delays in the UI are kinda irritating; I mean why can't it keep a little index of what machines & users its got in the backup and let me pick 'em in a second then leave the thing for a few hours while it restores?

Anyway - all is well - once I got past the 2nd screen, chose the things to restore I left it chugging away for a few hours and I'm now restored. The only thing I've missed so far is I had to reinstall my VPN client as it shoved stuff in /System and maven is hardwired in /usr/bin to point to mvn 2.0.6 in /usr/share - other than that it worked fine.

One final tip if you try and restore from Time Capsule/Time Machine; when you reinstall Leopard don't create a user account with the same ID as the one you are gonna restore - as the Migration Assistant forced me to rename the restored one (which caused some problems that took me a little while and some 'chown'ing to fix :).

Other than those little gremlins; nice job Apple! If I ever have another catastrophic failure, the next restore should be pretty painless

I'm liking JAX-RS and Jersey

A great post by Paul Sandoz on MVCJ. Jersey rocks!

I'm loving the simple JAX-RS POJO based programming model (quite Rails-ish) for writing controllers and models which work beautifully in a hi-RESTful way which also now support a rails-like way of implicit templates via JSP/Velocity/whatever with a minimal amount of fuss.

I'm liking the controller-is-the-model-facade option with implicit MVC too; so the model is totally decoupled from the web and the controller just has a few annotations to deal with binding methods nicely to the URI/REST/content types and so forth - then you can have as many representations of a model as you want - just write views (e.g. index.jsp, detail.jsp, brief.jsp or whatever). Lovely and Rails-ish

Its now pretty easy to write hi-rest web apps in Java which render content as (X)HTML, XML, JSON with nice RESTful content negotiation and using good URIs.

Wednesday, 14 May 2008

Apache ActiveMQ 5.1 and Apache ServiceMix Kernel 1.0-m3 Released!

Apache ActiveMQ 5.1.0 is now out. Both Bruce and Hiram cover this nicely - if you use ActiveMQ I'd recommend upgrading, its got tons of bug fixes.

Also things are really hotting up in the spiffy new OSGi based ServiceMix Kernel that has just released 1.0-m3. Both Guillaume and Bruce have the low down. Grab it while its hot!

Hopefully soon ActiveMQ may come built on ServiceMix Kernel by default which will certainly really help make it easy to hot-redeploy Enterprise Integration Patterns routing rules within the broker.

Monday, 12 May 2008

Monday, 21 April 2008

Getting hooked on twitter

For a while I kept seeing twitter being mentioned and kinda thought: why would I wanna know what some random person on the internet had for lunch?
I just didn't get it. I'm not totally sure I do get it yet - but I've kinda convinced myself of twitter by just thinking of it as an open IRC where you subscribe to people rather than chat rooms.

To use messaging middleware speak, I've not been the biggest fan of IM as it tends to lead to loads of point-to-point conversations with lots of duplication. I find myself saying the same thing again and again to people on IM. Plus IM feels way too invasive; I tend to hide away from IM to avoid getting hassled these days :). With IRC I can say stuff to the room instead which avoids me having to say the same thing again. Plus IRC tends to feel less invasive; I can read it when I feel like it but otherwise kinda ignore it

Twitter so far is kinda feeling like a combination of blogs, IRC and SMS; where you subscribe to people rather than rooms which helps cut down the noise. If someone's getting annoying or boring, just stop following them. The brevity of posts (140 characters) also helps trim down the noise and fluff leaving a mostly interesting stream of kinda mini-blog-posts and banter. So far I'm hooked! :)

If you are on OS X try out twitterific as a Twitter client. While IM is a pretty reasonable way to work with twitter - I do like not running my IM client and using twitterific instead :)

If you have an iphone there's a bunch of clients available; so far I'm liking twinkle

Feel free to follow me if you like. Also check out twubble as a great way to find new folks to follow - nice work crazybob!

Friday, 18 April 2008

Google AppEngine is very impressive!

After never having hacked any python before or looked closely at django and never having used BigTable, I spent a little over a day and managed to hack up, what is (to me anyway!)- is a very useful little web app I've wanted for a long time: http://latrz.appspot.com. Its highly scalable & available and resilient thanks to BigTable. Its kinda amazing really.

Sure Amazon has lots of similar stuff at the bits and bytes level. EC2, S3, SimpleDB and the new file system stuff are cool too, don't get me wrong. For some things the power and flexibility of the Amazon offerings are great. 

Though for creating web apps I love how AppEngine takes all the hassle out of figuring out how to host, load balance, deploy and manage your app. I didn't have to mess with elastic IPs or DNS or web proxies or figure out some load balancing stuff, get scalr to work or install some ninja unix file system into a vmware image that mirrors itself onto S3 or anything. I just hacked up some simple python on my laptop, tested it locally with the AppEngine SDK, typed a command into my terminal (while on a train :) and within seconds its live on googles infrastructure and working really well.

I guess some web developers are gonna push back on the use of python but I'm sure google will release Java / JavaScript flavours of AppEngine soon making it not much of an issue. Who knows maybe even PHP too - not sure about Ruby though, I dunno if they've figured out how to make a ruby sandbox yet.

I'm sure ultimately this is gonna be a big game changer for those making public web applications; it takes so much hassle out of making web apps - and makes creating highly scalable & available web apps very rapid & fun. Well done googlers; I'm very impressed.

Wednesday, 16 April 2008

Latrz - a handy web app for reading stuff later (latrz)

I've wanted something like this for the longest time! I've found when surfing, chatting online, working with email that I keep stumbling on loads of links to interesting stuff I wanna read - but just not right now - later.

I've often kept open loads of FireFox windows for stuff I should read soon (which then means I struggle to find what I am currently reading/working on from stuff I wanna read later). Then I've been through phases of cutting and pasting interesting articles into files/wikis for later. I've always felt this was sucky and wanted a nicer solution.

Now there's latrz and I confess to being totally hooked already :).

Basically if I'm on a page I know I wanna read, I click the Read Latrz bookmarket, then close the browser or carry on doing what I'm doing. Then when I've time I just click on the latrz site to read whatever takes my fancy, then mark it as read when I'm done to remove it from my reading list.

Go on, give it a try or subscribe to the Latrz Blog, you know you want to :)

Using Scala to create a better Camel DSL for Enterprise Integration Patterns

Gert Vanthienen has been doing some amazing work creating a DSL for Camel using Scala. I'm amazed at how neat and concise it is. Go Gert! :).

I'd previously experimented with Groovy and Ruby DSLs and found them to be little more verbose (e.g. having issues of needing to pass 2 closures/blocks to methods like when or filter, one for the predicate and one for the block to execute if its true).

You can grab his slides from the recent ApacheCon talk. I'm really liking it. The Scala use of separate syntax for functions/predicates and blocks helps improve the Camel DSL hugely

Thursday, 10 April 2008

Apache Camel 1.3.0 released with 208 new features & improvements

Its taken a while to get there but we've finally got the new Camel 1.3.0 Release out of the door which includes 208 new features, improvements and bug fixes described below. Also as David has blogged recently we've MSMQ support now along with Esper and an Esper Demo. Many thanks to all those who helped ride this beast out the door. Enjoy!

New Components

  • AMQP
  • DataSet for easier load testing
  • JCR for JSR 170 support
  • List for UI and tooling integration
  • Stream for working with input/output streams
  • Test for easier functional testing
  • XQuery for easy XQuery based transforms for Templating

New Data Formats

New Languages

New Enterprise Integration Patterns

Please see Release Notes for more details. Download it now while is hot to trot!

Thursday, 27 March 2008

[LazyWeb] a maven plugin to find resources on your maven dependency path

Every now and again I get the dreaded log4j.properties / log4j.xml maven transitive dependency hell. Some resource is included in multiple jars so the one you think you're meant to be using isn't found first. 

e.g. you try changing the log4j levels and nothing happens. Much scratching of head occurs. Normally through frustration you shove a load of System.out.println() calls in your app :)

So the idea is how about being able to do something like
mvn classpath:find -Dresource=log4j.properties
and the plugin would search all the test scoped jars on the classpath, including transitive dependencies letting you know all the jars (and the dependency path to them) which included the resource you specified.

It'd be handy right? Any volunteers... :)

Tuesday, 18 March 2008

Writing unit tests? Give hamcrest a try

I'm not sure if its that well known but if you are writing unit tests in JUnit 3.x, 4.x or TestNG take a look at the tutorial, add hamcrest-all.jar to your classpath/project/pom.xml then give hamcrest a spin. I think you'll like it. Here's the pom.xml change...
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
</dependency>
assertThat! :)

Friday, 14 March 2008

If you are tinkering with VMWare on OS X

then a few links to save you a little googling. If you wanna use some of the public VMWAre images such as Ubuntu 7.10 desktop then you might wanna use BitTorrent to download it, then to unpack the RAR file try UnRarX. I've found the nicest way to use VMWare on Leopard is to run each VM image in a separate Space in full screen mode which is pretty neat...

Friday, 7 March 2008

UFace getting hotter

Check out Tom's report on the latest improvements in UFace - pretty neat eh. Also using CSS cross web apps, Swing and Eclipse is hot.

Friday, 15 February 2008

Easier Integration & Pattern testing with Camel and Spring 2.5

I'm really liking the testing features in Spring 2.5.x for easier unit testing with JUnit 3.8, 4.x or TestNG using Spring to do all your dependency injection before invoking your test classes.

I've just created a little document to show how to use Spring Testing with Camel, using the Camel Mock and Test endpoints for easier Enterprise Integration Pattern based testing. Incidentally Camel now has a new little Test endpoint which creates a Mock endpoint that automatically pulls its expected message bodies from another endpoint and auto-wires up the expectations for easier testing with minimal coding.

Public Training on Apache ActiveMQ and Apache ServiceMix

As Bruce mentioned IONA is offering some public training courses on Apache ActiveMQ and Apache ServiceMix on the following dates for the first two...
  • London,UK - March 11-14
  • Waltham, MA - March 17-20
If you're using either ActiveMQ or ServiceMix then these training courses are highly recommended.

Wednesday, 6 February 2008

Using Apache Camel, ActiveMQ and Esper for Complex Event Processing

David Greco just checked in a cute little demo that shows how to work with Apache Camel for Enterprise Integration Patterns, ActiveMQ as the message broker and Esper for Complex Event Processing. Enjoy!

Update: David bas blogged about this too :)

Monday, 4 February 2008

rest-ws looks great

I've long been a fan of RelaxNG Compact Syntax (I guess RNC is the abbreviation) over XSDs. Now to avoid folks struggling with XSDs and WSDLs in nasty verbose angle brackets, there's the rather nice looking relax-ws. Now we just need a nice eclipse plugin... Enjoy!

Monday, 21 January 2008

[LazyWeb] using Subversion as a front end to Confluence?

I hack a lot of Confluence spaces as part of my job. I've been working on the UFace project at Google Code so I've been getting used to the Google way.

One of the great things about google code is that the wiki is in subversion as *.wiki files; so you can edit them in any text editor (and TextMate comes with great MoinMoin syntax support, you just have to install the bundle...). So you can grab your wiki content, jump on a plane, hack it with your favourite editor then check in your changes when you're next online.

I wonder how hard it'd be to sync Confluence content with a subversion repo; so folks could still use the online Confluence site to edit content, which would get mirrored to an svn repo as *.wiki files - then folks could commit to the svn repo to update the confluence database? Anyone ever tried?

Friday, 18 January 2008

bored of your OS X desktop? Try DeskLickr

DeskLickr rocks! Have your desktop change every few minutes/hours using a nice new picture from flickr using tagged queries. Neat!

Thursday, 17 January 2008

Quick review of Leopard, the latest OS X

I finally bought and upgraded to Leopard. Am liking it so far; Spaces is nice (though with a 30" and my 17" screens, I don't need many spaces, am mostly using a separate space for mail). The neatest thing of Spaces is when you use Expose to view your spaces (I'm using the move the mouse to the bottom right corner gesture), it shows both my 2 screens aligned for each space where I can drag and drop between both screens and spaces.

I love the new look and Cover Flow on Finder; don't much use the Dock as I use QuickSilver so the Stacks stuff doesn't get used.

I've gotta wait for me to buy a TimeCapsule before I can try out TimeMachine which does look cool. Apple are so good at sucking money out of my pocket :). Am gonna have to buy an Apple TV now too.... Wonder how long before they'll support the UK on movie rentals.

So far I still prefer iTerm to Terminal due to it being able to have preconfigured named shells & starting directories (I've often got tons of shells open).

The upgrade was great; I just installed the DVD, kicked off the install and came back later and it was all completed.

So far the only real nit was bash shells lost their prompt, so I had to add this to my .bashrc
export PS1="\w> "
Not an amazing upgrade or anything, but I am preferring Leopard.

Update : I've just noticed TextEdit now opens OpenDoc files natively - nice!

Wednesday, 16 January 2008

OpenSnoop is pretty handy!

See the details of how to use it on Leopard. I just used it to track the progress of my S3 online backup which was most useful.

Thursday, 10 January 2008

Develop rich UI applications in Eclipse/JFace, Swing, GWT, GWT-Ext or MyGWT using the same code via UFace

UFace is hot! Its early days & needs more work, but check out Tom's post on UFace progress - or even better come along and join the fun :)