Skip to content

Instantly share code, notes, and snippets.

@shimarin
Created January 10, 2009 07:04
Show Gist options
  • Save shimarin/45405 to your computer and use it in GitHub Desktop.
Save shimarin/45405 to your computer and use it in GitHub Desktop.
tc = connectionFactory.createTopicConnection
s = tc.createTopicSession(false,Java::javax.jms.TopicSession::AUTO_ACKNOWLEDGE)
tc.start
t=s.createTopic("*********Topic")
sub=s.createSubscriber(t)
10000.times {
@msg = sub.receive(1000)
break if @msg != nil
p "No message..."
}
s.close
tc.close
@msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment