{"action":"created","comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/comments/23517202","id":23517202,"diff_hunk":"@@ -0,0 +1,142 @@\n+# encoding: utf-8\n+require \"logstash/outputs/base\"\n+require \"logstash/namespace\"\n+\n+# Write events to a Jms Broker. Supports both Jms Queues and Topics.\n+#\n+# For more information about Jms, see <http://docs.oracle.com/javaee/6/tutorial/doc/bncdq.html>\n+# For more information about the Ruby Gem used, see <http://github.com/reidmorrison/jruby-jms>\n+# Here is a config example :\n+#\t jms {\n+#\t\t\tinclude_header => false\n+#\t\t\tinclude_properties => false\n+#\t\t\tinclude_body => true\n+#\t\t\tuse_jms_timestamp => false\n+#\t\t\tqueue_name => \"myqueue\"\n+#\t\t\tyaml_file => \"~/jms.yml\"\n+#\t\t\tyaml_section => \"mybroker\"\n+#\t\t}\n+#\n+#\n+class LogStash::Outputs::Jms < LogStash::Outputs::Base\n+\tconfig_name \"jms\"\n+\tmilestone 1\n+\n+# Initial connection timeout in seconds.\n+config :timeout, :validate => :number, :default => 1000\n+\n+# Name of delivery mode to use\n+# Options are \"persistent\" and \"non_persistent\" if not defined nothing will be passed.\n+# TODO(AlphaCluster) need to reconfigure delivery mode\n+#config :delivery_mode, :validate => :string, :default => nil\n+\n+# If pub-sub (topic) style should be used or not.\n+# Mandatory\n+config :pub_sub, :validate => :boolean, :default => false\n+# Name of the destination queue or topic to use.\n+# Mandatory\n+config :destination, :validate => :string\n+\n+# Yaml config file\n+config :yaml_file, :validate => :string\n+# Yaml config file section name\n+# For some known examples, see: [Example jms.yml](https://github.com/reidmorrison/jruby-jms/blob/master/examples/jms.yml)\n+config :yaml_section, :validate => :string\n+\n+# If you do not use an yaml configuration use either the factory or jndi_name.\n+\n+# An optional array of Jar file names to load for the specified\n+# JMS provider. By using this option it is not necessary\n+# to put all the JMS Provider specific jar files into the\n+# java CLASSPATH prior to starting Logstash.\n+config :require_jars, :validate => :array\n+\n+# Name of JMS Provider Factory class\n+config :factory, :validate => :string\n+# Username to connect to JMS provider with\n+config :username, :validate => :string\n+# Password to use when connecting to the JMS provider\n+config :password, :validate => :string\n+# Url to use when connecting to the JMS provider\n+config :broker_url, :validate => :string\n+\n+# Name of JNDI entry at which the Factory can be found\n+config :jndi_name, :validate => :string\n+# Mandatory if jndi lookup is being used,\n+# contains details on how to connect to JNDI server\n+config :jndi_context, :validate => :hash\n+\n+# :yaml_file, :factory and :jndi_name are mutually exclusive, both cannot be supplied at the\n+# same time. The priority order is :yaml_file, then :jndi_name, then :factory\n+#\n+# JMS Provider specific properties can be set if the JMS Factory itself\n+# has setters for those properties.\n+#\n+# For some known examples, see: [Example jms.yml](https://github.com/reidmorrison/jruby-jms/blob/master/examples/jms.yml)\n+\n+\tpublic\n+\tdef register\n+\t\trequire \"jms\"\n+\t\t@connection = nil\n+\n+\t\tif @yaml_file\n+\t\t\t@jms_config = YAML.load_file(@yaml_file)[@yaml_section]\n+\n+\t\telsif @jndi_name\n+\t\t\t@jms_config = {\n+\t\t\t\t:require_jars => @require_jars,\n+\t\t\t\t:jndi_name => @jndi_name,\n+\t\t\t\t:jndi_context => @jndi_context}\n+\n+\t\telsif @factory\n+\t\t\t@jms_config = {\n+\t\t\t\t:require_jars => @require_jars,\n+\t\t\t\t:factory => @factory,\n+\t\t\t\t:username => @username,\n+\t\t\t\t:password => @password,\n+\t\t\t\t:broker_url => @broker_url,\n+\t\t\t\t:url => @broker_url # \"broker_url\" is named \"url\" with Oracle AQ\n+\t\t\t\t}\n+\t\tend\n+\n+\t\t@logger.debug(\"JMS Config being used\", :context => @jms_config)\n+\t\t@connection = JMS::Connection.new(@jms_config)\n+\t\t@session = @connection.create_session()\n+\n+\t\t# Cache the producer since we should keep reusing this one.\n+\t\tif (@pub_sub)\n+\t\t\t@producer = @session.create_producer(@session.create_destination(:topic_name => @destination))\n+\t\telse\n+\t\t\t@producer = @session.create_producer(@session.create_destination(:queue_name => @destination))\n+\t\tend\n+\n+\t\tif !@delivery_mode.nil?\n+\t\t\t@producer.delivery_mode_sym = @deliver_mode\n+\t\tend\n+\tend # def register\n+\n+\tdef receive(event)\n+\t\t\treturn unless output?(event)\n+\n+\t\t\tbegin\n+\t\t\t\t@producer.send(@session.message(event.to_json))\n+#\t\t\t\tif @queue_name","path":"lib/logstash/outputs/jms.rb","position":123,"original_position":123,"commit_id":"c4edd347a17ef62c251bd2a5e4d5c67ed1bf53e1","original_commit_id":"c4edd347a17ef62c251bd2a5e4d5c67ed1bf53e1","user":{"login":"purbon","id":68540,"avatar_url":"https://avatars.githubusercontent.com/u/68540?v=3","gravatar_id":"","url":"https://api.github.com/users/purbon","html_url":"https://github.com/purbon","followers_url":"https://api.github.com/users/purbon/followers","following_url":"https://api.github.com/users/purbon/following{/other_user}","gists_url":"https://api.github.com/users/purbon/gists{/gist_id}","starred_url":"https://api.github.com/users/purbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purbon/subscriptions","organizations_url":"https://api.github.com/users/purbon/orgs","repos_url":"https://api.github.com/users/purbon/repos","events_url":"https://api.github.com/users/purbon/events{/privacy}","received_events_url":"https://api.github.com/users/purbon/received_events","type":"User","site_admin":false},"body":"I do understand this is not valid anymore, we should clean up this commented code.","created_at":"2015-01-26T08:46:05Z","updated_at":"2015-01-26T08:46:05Z","html_url":"https://github.com/logstash-plugins/logstash-output-jms/pull/1#discussion_r23517202","pull_request_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/comments/23517202"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-jms/pull/1#discussion_r23517202"},"pull_request":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1","id":27997532,"html_url":"https://github.com/logstash-plugins/logstash-output-jms/pull/1","diff_url":"https://github.com/logstash-plugins/logstash-output-jms/pull/1.diff","patch_url":"https://github.com/logstash-plugins/logstash-output-jms/pull/1.patch","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/1","number":1,"state":"open","locked":false,"title":"Initial checkin for JMS","user":{"login":"AlphaCluster","id":5531298,"avatar_url":"https://avatars.githubusercontent.com/u/5531298?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaCluster","html_url":"https://github.com/AlphaCluster","followers_url":"https://api.github.com/users/AlphaCluster/followers","following_url":"https://api.github.com/users/AlphaCluster/following{/other_user}","gists_url":"https://api.github.com/users/AlphaCluster/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaCluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaCluster/subscriptions","organizations_url":"https://api.github.com/users/AlphaCluster/orgs","repos_url":"https://api.github.com/users/AlphaCluster/repos","events_url":"https://api.github.com/users/AlphaCluster/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaCluster/received_events","type":"User","site_admin":false},"body":"Moving output from logstash-contrib. Should work but doesn’t have a\r\ncompleted rspec file yet.","created_at":"2015-01-25T20:36:29Z","updated_at":"2015-01-26T08:46:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c0ff2a8ec64f36e6e6184f3b2cde4d265e39bef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1/commits","review_comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1/comments","review_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/comments/{number}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/1/comments","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/statuses/c4edd347a17ef62c251bd2a5e4d5c67ed1bf53e1","head":{"label":"AlphaCluster:master","ref":"master","sha":"c4edd347a17ef62c251bd2a5e4d5c67ed1bf53e1","user":{"login":"AlphaCluster","id":5531298,"avatar_url":"https://avatars.githubusercontent.com/u/5531298?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaCluster","html_url":"https://github.com/AlphaCluster","followers_url":"https://api.github.com/users/AlphaCluster/followers","following_url":"https://api.github.com/users/AlphaCluster/following{/other_user}","gists_url":"https://api.github.com/users/AlphaCluster/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaCluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaCluster/subscriptions","organizations_url":"https://api.github.com/users/AlphaCluster/orgs","repos_url":"https://api.github.com/users/AlphaCluster/repos","events_url":"https://api.github.com/users/AlphaCluster/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaCluster/received_events","type":"User","site_admin":false},"repo":{"id":29829076,"name":"logstash-output-jms","full_name":"AlphaCluster/logstash-output-jms","owner":{"login":"AlphaCluster","id":5531298,"avatar_url":"https://avatars.githubusercontent.com/u/5531298?v=3","gravatar_id":"","url":"https://api.github.com/users/AlphaCluster","html_url":"https://github.com/AlphaCluster","followers_url":"https://api.github.com/users/AlphaCluster/followers","following_url":"https://api.github.com/users/AlphaCluster/following{/other_user}","gists_url":"https://api.github.com/users/AlphaCluster/gists{/gist_id}","starred_url":"https://api.github.com/users/AlphaCluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlphaCluster/subscriptions","organizations_url":"https://api.github.com/users/AlphaCluster/orgs","repos_url":"https://api.github.com/users/AlphaCluster/repos","events_url":"https://api.github.com/users/AlphaCluster/events{/privacy}","received_events_url":"https://api.github.com/users/AlphaCluster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlphaCluster/logstash-output-jms","description":"","fork":true,"url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms","forks_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/forks","keys_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/teams","hooks_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/hooks","issue_events_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/issues/events{/number}","events_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/events","assignees_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/assignees{/user}","branches_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/branches{/branch}","tags_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/tags","blobs_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/statuses/{sha}","languages_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/languages","stargazers_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/stargazers","contributors_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/contributors","subscribers_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/subscribers","subscription_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/subscription","commits_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/issues/comments/{number}","contents_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/contents/{+path}","compare_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/merges","archive_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/downloads","issues_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/issues{/number}","pulls_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/pulls{/number}","milestones_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/milestones{/number}","notifications_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/labels{/name}","releases_url":"https://api.github.com/repos/AlphaCluster/logstash-output-jms/releases{/id}","created_at":"2015-01-25T20:12:12Z","updated_at":"2015-01-25T20:36:00Z","pushed_at":"2015-01-25T20:35:59Z","git_url":"git://github.com/AlphaCluster/logstash-output-jms.git","ssh_url":"git@github.com:AlphaCluster/logstash-output-jms.git","clone_url":"https://github.com/AlphaCluster/logstash-output-jms.git","svn_url":"https://github.com/AlphaCluster/logstash-output-jms","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"logstash-plugins:master","ref":"master","sha":"0e7244c21fa42b77ec6c118c95f6c2111432a7d0","user":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"repo":{"id":29746186,"name":"logstash-output-jms","full_name":"logstash-plugins/logstash-output-jms","owner":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/logstash-plugins/logstash-output-jms","description":"","fork":false,"url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms","forks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/forks","keys_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/teams","hooks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/hooks","issue_events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/events{/number}","events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/events","assignees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/assignees{/user}","branches_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/branches{/branch}","tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/tags","blobs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/git/refs{/sha}","trees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/statuses/{sha}","languages_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/languages","stargazers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/stargazers","contributors_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/contributors","subscribers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/subscribers","subscription_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/subscription","commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/commits{/sha}","git_commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/git/commits{/sha}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/comments{/number}","issue_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/comments/{number}","contents_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/contents/{+path}","compare_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/merges","archive_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/downloads","issues_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues{/number}","pulls_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls{/number}","milestones_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/milestones{/number}","notifications_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/labels{/name}","releases_url":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/releases{/id}","created_at":"2015-01-23T18:18:51Z","updated_at":"2015-01-23T18:18:51Z","pushed_at":"2015-01-23T18:18:51Z","git_url":"git://github.com/logstash-plugins/logstash-output-jms.git","ssh_url":"git@github.com:logstash-plugins/logstash-output-jms.git","clone_url":"https://github.com/logstash-plugins/logstash-output-jms.git","svn_url":"https://github.com/logstash-plugins/logstash-output-jms","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-jms/pull/1"},"issue":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/1"},"comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-jms/statuses/c4edd347a17ef62c251bd2a5e4d5c67ed1bf53e1"}}}}