JMS made really, really easy.
Just once in a while, you have this idea that makes you think - wow, that would be cool. I had one of those a couple of weeks ago and when I spoke to other people about it, they had the same reaction. The idea is simple. Create a pseudo-filesystem on top of JMS. After 2 or three days of huddling over my desk I had a working prototype based on the FUSE and FUSE-J projects.
So far, you can do the following:
- Mount a JMS server at a specified directory
- The queues on the server become subdirectories
- ls -l on a queue shows the current queue depth
- mkdir and rmdir create and delete queues
- The messages become files in the subdirectories
- ls -l on a message shows it's size, and the creation date
- You can "cat" any message (or open it in an editor) to show it's contents - non-destructive!
- You can copy a message to a real filesystem
- You can delete messages
- You can copy files to a queue and they are published as messages
Essentially, you are interacting with a queue exactly as you would a filesystem.
There seem to be a lot of benefits in this:
- With a minimal footprint, a partner or remote office can send you messages over JMS, if they know how to copy files (even my dad could do this)*.
- If you're already doing file-based integration, there are no code changes necessary to send or receive data.
- You get all the failover and clustering aspects of JMS "for free".
- Monitoring of a server becomes trivial. Removing (or even changing) bad messages is a no-brainer.
Here's a screenshot. You can't tell that these are messages on a queue, can you? ;-)
Would any of you people out there in internetland be interested in seeing this? I'm considering making it an open source project on java.net very soon but the name "JMSFS" seems a little dull; feel free to suggest something else!
* After two hours on the phone this evening providing family tech support, I realise I might have been stretching the truth with this point.
I'd be interested in trying it out, mostly for the administration potential.
Posted by jgunz on July 11, 2008 at 01:53 AM BST #
Very interesting indeed!
Posted by Seymour Cakes on July 11, 2008 at 09:53 AM BST #
This is really really cool !
Reminds me a bit of the old IQM which was open enough to do something similar, although not as funky as this.
Can you pick this up with Frank Kieviet so it gets into the converged Message Queue ? A future version will incorporate an HA file-based data storage, but flipping that logic around is very powerful.
Posted by Paul on July 11, 2008 at 09:56 AM BST #
The idea is absolutely great! Strange that nobody got it earlier...
It would allow a "free" integration between JMS and a lot of file-based technology, like FTP. I would be interested to contribute
Posted by Mathieu P. on July 11, 2008 at 11:06 AM BST #
Interesting approach...could be used in conjunction with an ESB that has a directory watcher setup. I wonder how performance is with your implementation.
Would be interested in seeing this on dev.java.net (or elsewhere) so we can check out the code.
Posted by codecraig on July 11, 2008 at 12:14 PM BST #
I'm absolutely interested in this! I'll check it out when the source will be available.
Posted by Mark Tolmacs on July 11, 2008 at 12:44 PM BST #
What about LS4JMS as the name :) ?
Posted by Martin Smith on July 11, 2008 at 01:48 PM BST #
I think you know my views on this already - it's a great idea! I particularly like the way it can be used for virtually anybody with basic UNIX skills to monitor and manage queues without needing to prepare scripts for JMX-specific command line syntax or try to plug in to something like Hermes. I suppose you can use a tool like grep to search the queues too. The possibilities are endless!
Posted by Louis Polycarpou on July 11, 2008 at 03:01 PM BST #
I should be reading these more often. This is quite cool!
As for names: how about Visual JMS: or vJMS
Posted by Gev on July 11, 2008 at 03:03 PM BST #
Brilliant! My name suggestion is here:
http://bsnyderblog.blogspot.com/2008/07/dead-simple-jms.html
Posted by Bruce Snyder on July 11, 2008 at 04:29 PM BST #
Really cool!!! makes life so simple...
Posted by Tuhin on July 11, 2008 at 06:19 PM BST #
It's a filesystem type, so how about jmsfs
Posted by jgunz on July 11, 2008 at 06:59 PM BST #
I think this would be a very cool addition to java.net. Definitely publish the code.
Posted by elihusmails on July 11, 2008 at 07:30 PM BST #
Why don't you contribute it to activemq or camel?
Posted by bwtaylor on July 11, 2008 at 09:04 PM BST #
i would love to see the code :-) makes live very easy for non EAI/Java nterprise interested people like operators etc.
Posted by Christian Brennsteiner on July 12, 2008 at 01:02 AM BST #
Good job. BIG drawback: it doesn't support transactions. It's not possible to insert >1 messages into a queue with transaction isolation. I figure as soon as a file is copied to a queue directory, any JMS consumer would be able to pick it up.
Possible solution: If you want to transcationally put messages in a queue, create a new temporary directory inside the queue directory with the sticky bit set. Then move messages to that new directory as desired, on commit remove the sticky bit. The driver should create a new local JMS transaction when it sees the new directory. Whenever a message appears in the new directory, the driver would insert it into the queue withtin its transaction. When the sticky bit is removed the driver would commit its transaction and remove the temporary directory.
Posted by Odi on July 12, 2008 at 10:04 AM BST #
Very good.
Shame your name isn't Jim - as in JiMSFiSh
Posted by Rob Anderson on July 15, 2008 at 08:21 PM BST #
Nice Work, and Nice Idea...
What about fs4jms ( File System 4 JMS or like jgunz says jmsfs), ds-jms (dead simple JMS) it seems like Data Source-JMS ,...
However it's a great idea!
Bravo!!!
Posted by Roberto Carlos Gonzalez Flores on July 16, 2008 at 12:59 AM BST #
How about QueueFS for the name?
Posted by DAR on July 17, 2008 at 12:36 AM BST #
I'd be *very* interested in this! As mentioned above, transactional support would be awesome as well.
Posted by Benjamin Smith on August 05, 2008 at 01:47 PM BST #
Cool hack :) but still, inotify or dnotify wouldn't work on it, when new messages are enqueued at the server for example.
Posted by ioj on August 08, 2008 at 05:02 PM BST #
I see from the FUSE-J project that hasn't been a release since 2006. Do you consider this to be a problem? I was considering utilizing FUSE-J, but the lack of releases concerned me a bit. Any thoughts on this?
Posted by Trond Andersen on March 21, 2009 at 11:15 PM GMT #