<commit_before>= jsparrow

JSparrow is a JMS client based on JRuby. Previously it has been called Sparrow, but changed his name because has another project with the same name.

=== Install

Make gem install:

  sudo gem install jsparrow -s http://gemcutter.org

=== Example

===== Three steps to send and receive JMS messages to/from a JMS middleware.

WARNING: OpenJMS will be used as JMS middleware, but any other could be used with no problems.

1) Create my_jsparrow_test.rb file and require the gems

  require 'rubygems'
  require 'jsparrow'

2) Setup indispensable informations to connect your JMS middleware

  JSparrow::Connection.configure do |connection|
    connection.use_jms_client_jar '/opt/openjms/lib/openjms-0.7.7-beta-1.jar'

    connection.use_jndi_properties :initial_context_factory => 'org.exolab.jms.jndi.InitialContextFactory',
                                   :provider_url            => 'tcp://localhost:3035'
                                 # :security_principal      => 'user',
                                 # :security_credentials    => 'password'

    connection.enable_connection_factories :queue_connection_factory => 'ConnectionFactory', 
                                           :topic_connection_factory => 'ConnectionFactory'
  end

3) Create the client and setup a queue

  jms_client = JSparrow::Connection.new_client
  jms_client.enable_queues :pardal_queue => 'MyQueue'
  
4) After appropriate setup, start the client

  jms_client.start

5) OK! Now you can send and receive messages right now!

  jms_client.queue_sender(:my_queue).send_text_message('jsparrow rocks!') do |msg|
    msg.set_string_property('recipient', 'jsparrow-example')
  end

  jms_client.queue_receiver(:my_queue).receive_message(
      :timeout  => 5000,
      :selector => "recipient = 'jsparrow-example'"
    ) do |msg|
    
    puts msg.is_text_message?    # true
    puts msg.text                # jsparrow rocks!
  end

6) After you receive your amazing messages, stop the client

  jms_client.stop

So, now that you did code and save it, start the OpenJMS server, create the queue (MyQueue), and run above script:

  jruby my_jsparrow_test.rb

jsparrow rocks! =)

== Copyright

Copyright (c) 2009 <NAME> <<EMAIL>>. See LICENSE for details.<commit_msg>name changed<commit_after>= jsparrow

JSparrow is a JMS client based on JRuby. Previously it has been called Sparrow, but changed his name because has another project with the same name.

=== Install

Make gem install:

  sudo gem install jsparrow -s http://gemcutter.org

=== Example

===== Three steps to send and receive JMS messages to/from a JMS middleware.

WARNING: OpenJMS will be used as JMS middleware, but any other could be used with no problems.

1) Create my_jsparrow_test.rb file and require the gems

  require 'rubygems'
  require 'jsparrow'

2) Setup indispensable informations to connect your JMS middleware

  JSparrow::Connection.configure do |connection|
    connection.use_jms_client_jar '/opt/openjms/lib/openjms-0.7.7-beta-1.jar'

    connection.use_jndi_properties :initial_context_factory => 'org.exolab.jms.jndi.InitialContextFactory',
                                   :provider_url            => 'tcp://localhost:3035'
                                 # :security_principal      => 'user',
                                 # :security_credentials    => 'password'

    connection.enable_connection_factories :queue_connection_factory => 'ConnectionFactory', 
                                           :topic_connection_factory => 'ConnectionFactory'
  end

3) Create the client and setup a queue

  jms_client = JSparrow::Connection.new_client
  jms_client.enable_queues :pardal_queue => 'MyQueue'
  
4) After appropriate setup, start the client

  jms_client.start

5) OK! Now you can send and receive messages right now!

  jms_client.queue_sender(:my_queue).send_text_message('jsparrow rocks!') do |msg|
    msg.set_string_property('recipient', 'jsparrow-example')
  end

  jms_client.queue_receiver(:my_queue).receive_message(
      :timeout  => 5000,
      :selector => "recipient = 'jsparrow-example'"
    ) do |msg|
    
    puts msg.is_text_message?    # true
    puts msg.text                # jsparrow rocks!
  end

6) After you receive your amazing messages, stop the client

  jms_client.stop

So, now that you did code and save it, start the OpenJMS server, create the queue (MyQueue), and run above script:

  jruby my_jsparrow_test.rb

jsparrow rocks! =)

== Copyright

Copyright (c) 2009 <NAME> (CodeZone) <<EMAIL>>. See LICENSE for details.
{'fraction_non_alphanumeric': 0.0840630472854641, 'fraction_numerical': 0.009632224168126095, 'mean_word_length': 3.0613333333333332, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1005512', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1320, 'n_words': 421}