aspose file tools*
The moose likes Other Languages and the fly likes Ruby (or JRuby) and JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Ruby (or JRuby) and JMS" Watch "Ruby (or JRuby) and JMS" New topic
Author

Ruby (or JRuby) and JMS

Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I'm currently working on an "enterprise" system which makes a lot of use of JMS messaging. Testing this is system is turning out to be an irritating job using Java, as we have to compile locally then laboriously and manually sftp class files to the production server in order to run them.

I'd love to have access to a decent scripting language to speed up this process, and Ruby is my current favourite.

So, has anyone else used Ruby or JRuby to connect, send and recieve JMS messages? Any suggestions of pre-written libraries or examples?

If such things exist for another scripting language I'd consider that too, provided it runs on Solaris and installs/runs from a regular user account.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I suppose you could either:

1) use JRuby (require_class 'javax.jms.Foo'; Foo.new) and simply "port" your Java JMS client code to Ruby

2) use Ruby and a native client library for your specific JMS provider, if applicable

And if you happen to use ActiveMQ as your JMS provider, you could also use the STOMP protocol for which there is a native Ruby client available.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Oh, and 3) use RJNI.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Thanks. I'd seen the STOMP stuff, but as we are mainly contacting queues hosted on WebLogic servers, I guess that doesn't apply.

I'll have a go with the JRuby port approach and see how well it works.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

1) use JRuby (require_class 'javax.jms.Foo'; Foo.new) and simply "port" your Java JMS client code to Ruby

How well does a jms message map to jruby messages? Do they intergrate fine?


Groovy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Pradip Bhat:
How well does a jms message map to jruby messages? Do they intergrate fine?

There is no mapping involved. With JRuby, you're running on a JVM and the message object you manipulate is essentially the same message object that you would manipulate with pure Java. There's just a bit of Reflection-based magic in between to delegate method calls inside the JRuby interpreter into method calls in the JVM.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ruby (or JRuby) and JMS