JMS with JRuby and ActiveMQ
|
|
|
|
| Articles Reviews Ruby | |
| Written by George Malamidis | |
| Tuesday, 10 July 2007 | |
|
{mos_sb_discuss:50}
One of the most interesting (and powerful) features of JRuby is the ability to access and manipulate Java classes and libraries. The code below creates, configures and starts an instance of an ActiveMQ Broker that accepts connections based on the Stomp protocol. require "java" require "apache-activemq-4.1.1.jar" include_class "org.apache.activemq.broker.BrokerService" broker = BrokerService.new broker.add_connector("stomp://localhost:61613") broker.start Supposing this code has been saved in a file named broker.rb, and given a working JRuby installation, we can start the Broker by invoking jruby broker.rb. Alternatively it can be placed in any of the locations described in the Require and Load behavior page on the JRuby Wiki.
Powered by jReviews |
|
| Last Updated ( Tuesday, 10 July 2007 ) | |
| < Prev | Next > |
|---|







