A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://kasparov.skife.org/blog/src/java/jruby-rocks.html below:

Brian McCallister

JRuby Rocks

So, trying to reproduce a timing issue in ActiveMQ failover (which Hiram seems to have fixed in the recent 4.0.2 release, thank you!) I was able to whip various clients together super-quick:

#!/usr/bin/env jruby
require 'java'

module AMQFailoverTest
  include_package "org.apache.activemq"
  include_class "javax.jms.Session"

  b = "failover://(tcp://golem:35000,tcp://golem:35001)"
  factory = ActiveMQConnectionFactory.new b
  connection = factory.createConnection();
  session = connection.createSession(false, Session::AUTO_ACKNOWLEDGE)
  producer = session.createProducer(session.createTopic("test"))

  loop do
    producer.send(session.createTextMessage("this is only a test"))
  end
end

Thank you, JRuby folks! :-)

0 writebacks [/src/java] permanent link


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4