• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ruby (or JRuby) and JMS

 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, and 3) use RJNI.
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic