rubywmq 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
  == Description
2
- rubywmq - Ruby WMQ is a Ruby interface into WebSphere MQ, previously called MQSeries
2
+ rubywmq - RubyWMQ is a Ruby interface into WebSphere MQ, previously called MQSeries
3
3
 
4
4
  == Synopsis
5
5
  require 'wmq'
data/examples/put1_a.rb CHANGED
@@ -1,25 +1,25 @@
1
- ################################################################################
2
- # Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- ################################################################################
16
-
17
- #
18
- # Sample : put1() : Put a single message to a queue
19
- #
20
- require 'rubygems'
21
- require 'wmq/wmq'
22
-
23
- WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
24
- qmgr.put(:q_name=>'TEST.QUEUE', :data => 'Hello World')
25
- end
1
+ ################################################################################
2
+ # Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ ################################################################################
16
+
17
+ #
18
+ # Sample : put1() : Put a single message to a queue
19
+ #
20
+ require 'rubygems'
21
+ require 'wmq/wmq'
22
+
23
+ WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
24
+ qmgr.put(:q_name=>'TEST.QUEUE', :data => 'Hello World')
25
+ end
@@ -1,48 +1,48 @@
1
- ################################################################################
2
- # Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- ################################################################################
16
-
17
- #
18
- # Example: q_to_files: Copy all messages in a queue to separate files in a directory
19
- #
20
- require 'rubygems'
21
- require 'find'
22
- require 'yaml'
23
- require 'wmq/wmq'
24
- require 'fileutils'
25
-
26
- # Call program passing environment name as first parameter
27
- # The environment corresponds to an entry in the config file
28
- env = ARGV[0] || raise("Command line argument 'environment' is required")
29
- config = YAML::load_file('q_to_files.cfg')[env]
30
-
31
- # Create supplied path if it does not exist
32
- path = config['target_directory']
33
- FileUtils.mkdir_p(path)
34
-
35
- message = WMQ::Message.new
36
- message.descriptor = config['descriptor'] || {}
37
- tstart = Time.now
38
- counter = 0
39
- WMQ::QueueManager.connect(config['qmgr_options']) do |qmgr|
40
- qmgr.open_queue(config['input_queue']) do |queue|
41
- queue.each do |message|
42
- counter = counter + 1
43
- File.open(File.join(path, "message_%03d" % counter), 'w') {|file| file.write(message.data) }
44
- end
45
- end
46
- end
47
- duration = Time.now - tstart
48
- printf "Processed #{counter} messages in %.3f seconds. Average: %.3f messages/second\n", duration, counter/duration
1
+ ################################################################################
2
+ # Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ ################################################################################
16
+
17
+ #
18
+ # Example: q_to_files: Copy all messages in a queue to separate files in a directory
19
+ #
20
+ require 'rubygems'
21
+ require 'find'
22
+ require 'yaml'
23
+ require 'wmq/wmq'
24
+ require 'fileutils'
25
+
26
+ # Call program passing environment name as first parameter
27
+ # The environment corresponds to an entry in the config file
28
+ env = ARGV[0] || raise("Command line argument 'environment' is required")
29
+ config = YAML::load_file('q_to_files.cfg')[env]
30
+
31
+ # Create supplied path if it does not exist
32
+ path = config['target_directory']
33
+ FileUtils.mkdir_p(path)
34
+
35
+ message = WMQ::Message.new
36
+ message.descriptor = config['descriptor'] || {}
37
+ tstart = Time.now
38
+ counter = 0
39
+ WMQ::QueueManager.connect(config['qmgr_options']) do |qmgr|
40
+ qmgr.open_queue(config['input_queue']) do |queue|
41
+ queue.each do |message|
42
+ counter = counter + 1
43
+ File.open(File.join(path, "message_%03d" % counter), 'w') {|file| file.write(message.data) }
44
+ end
45
+ end
46
+ end
47
+ duration = Time.now - tstart
48
+ printf "Processed #{counter} messages in %.3f seconds. Average: %.3f messages/second\n", duration, counter/duration
data/ext/build.sh CHANGED
File without changes