rubywmq 0.3.0-i386-mswin32-mq5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/LICENSE +13 -0
  2. data/README +73 -0
  3. data/doc/classes/WMQ/Message.html +376 -0
  4. data/doc/classes/WMQ/Message.src/M000001.html +77 -0
  5. data/doc/classes/WMQ/Message.src/M000002.html +27 -0
  6. data/doc/classes/WMQ/Queue.html +1459 -0
  7. data/doc/classes/WMQ/Queue.src/M000003.html +205 -0
  8. data/doc/classes/WMQ/Queue.src/M000004.html +107 -0
  9. data/doc/classes/WMQ/Queue.src/M000005.html +198 -0
  10. data/doc/classes/WMQ/Queue.src/M000006.html +66 -0
  11. data/doc/classes/WMQ/Queue.src/M000007.html +203 -0
  12. data/doc/classes/WMQ/Queue.src/M000008.html +265 -0
  13. data/doc/classes/WMQ/Queue.src/M000009.html +120 -0
  14. data/doc/classes/WMQ/Queue.src/M000010.html +28 -0
  15. data/doc/classes/WMQ/Queue.src/M000011.html +30 -0
  16. data/doc/classes/WMQ/Queue.src/M000012.html +31 -0
  17. data/doc/classes/WMQ/Queue.src/M000013.html +31 -0
  18. data/doc/classes/WMQ/Queue.src/M000014.html +31 -0
  19. data/doc/classes/WMQ/QueueManager.html +1529 -0
  20. data/doc/classes/WMQ/QueueManager.src/M000015.html +182 -0
  21. data/doc/classes/WMQ/QueueManager.src/M000016.html +194 -0
  22. data/doc/classes/WMQ/QueueManager.src/M000017.html +92 -0
  23. data/doc/classes/WMQ/QueueManager.src/M000018.html +70 -0
  24. data/doc/classes/WMQ/QueueManager.src/M000019.html +49 -0
  25. data/doc/classes/WMQ/QueueManager.src/M000020.html +49 -0
  26. data/doc/classes/WMQ/QueueManager.src/M000021.html +63 -0
  27. data/doc/classes/WMQ/QueueManager.src/M000022.html +61 -0
  28. data/doc/classes/WMQ/QueueManager.src/M000023.html +65 -0
  29. data/doc/classes/WMQ/QueueManager.src/M000024.html +232 -0
  30. data/doc/classes/WMQ/QueueManager.src/M000025.html +30 -0
  31. data/doc/classes/WMQ/QueueManager.src/M000026.html +31 -0
  32. data/doc/classes/WMQ/QueueManager.src/M000027.html +31 -0
  33. data/doc/classes/WMQ/QueueManager.src/M000028.html +38 -0
  34. data/doc/classes/WMQ/QueueManager.src/M000029.html +33 -0
  35. data/doc/classes/WMQ/QueueManager.src/M000030.html +21 -0
  36. data/doc/classes/WMQ/QueueManager.src/M000031.html +284 -0
  37. data/doc/classes/WMQ/QueueManager.src/M000032.html +24 -0
  38. data/doc/classes/WMQ/QueueManager.src/M000033.html +18 -0
  39. data/doc/classes/WMQ/QueueManager.src/M000034.html +46 -0
  40. data/doc/classes/WMQ/QueueManager.src/M000035.html +27 -0
  41. data/doc/classes/WMQ/WMQException.html +111 -0
  42. data/doc/classes/WMQ.html +6300 -0
  43. data/doc/created.rid +1 -0
  44. data/doc/files/ext/lib/wmq_const_admin_rb.html +128 -0
  45. data/doc/files/ext/lib/wmq_const_rb.html +128 -0
  46. data/doc/files/ext/lib/wmq_temp_rb.html +122 -0
  47. data/doc/files/ext/wmq_c.html +101 -0
  48. data/doc/files/ext/wmq_message_c.html +101 -0
  49. data/doc/files/ext/wmq_queue_c.html +101 -0
  50. data/doc/files/ext/wmq_queue_manager_c.html +101 -0
  51. data/doc/fr_class_index.html +31 -0
  52. data/doc/fr_file_index.html +33 -0
  53. data/doc/fr_method_index.html +61 -0
  54. data/doc/index.html +24 -0
  55. data/doc/rdoc-style.css +208 -0
  56. data/examples/each_a.rb +31 -0
  57. data/examples/each_b.rb +40 -0
  58. data/examples/each_header.rb +37 -0
  59. data/examples/files_to_q.cfg +24 -0
  60. data/examples/files_to_q.rb +46 -0
  61. data/examples/get_a.rb +34 -0
  62. data/examples/get_client.rb +50 -0
  63. data/examples/put1_a.rb +24 -0
  64. data/examples/put1_b.rb +32 -0
  65. data/examples/put1_c.rb +31 -0
  66. data/examples/put_a.rb +34 -0
  67. data/examples/put_b.rb +42 -0
  68. data/examples/put_dlh.rb +40 -0
  69. data/examples/put_dynamic_q.rb +37 -0
  70. data/examples/put_rfh.rb +66 -0
  71. data/examples/put_rfh2_a.rb +42 -0
  72. data/examples/put_rfh2_b.rb +42 -0
  73. data/examples/put_xmit_q.rb +32 -0
  74. data/examples/q_to_files.cfg +17 -0
  75. data/examples/q_to_files.rb +47 -0
  76. data/examples/request.rb +59 -0
  77. data/examples/server.rb +96 -0
  78. data/lib/wmq/wmq.so +0 -0
  79. data/lib/wmq/wmq_const.rb +697 -0
  80. data/lib/wmq/wmq_const_admin.rb +273 -0
  81. data/lib/wmq/wmq_temp.rb +197 -0
  82. data/lib/wmq.rb +25 -0
  83. data/tests/test.rb +299 -0
  84. metadata +131 -0
@@ -0,0 +1,96 @@
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 : Sample program to show how to write a server side application
19
+ #
20
+ # This server times out after 60 seconds, but could be modified to
21
+ # run forever. Example:
22
+ # queue.each(:wait=>-1) do |message|
23
+ #
24
+ # Note: - All calls are being performed under synchpoint control to
25
+ # prevent messages being if the program terminates unexpectedly
26
+ # or an error occurrs.
27
+ # Uses: :sync=>true
28
+ # - Queue#each will backout any message changes if an excecption is raised
29
+ # but not handled within the each block
30
+ #
31
+ # A "well-behaved" WebSphere MQ application should adhere to the following rules:
32
+ # - Perform puts and gets under synchpoint where applicable
33
+ # - Only send replies to Request messages. No reply for Datagrams
34
+ # - Set the message type to Reply when replying to a request message
35
+ # - Reply with:
36
+ # - Remaining Expiry (Ideally deduct any processing time since get)
37
+ # - Same priority as received message
38
+ # - Same persistence as received message
39
+ # - Adhere to the Report options supplied for message and correlation id's
40
+ # in reply message
41
+ # - All headers must be returned on reply messages
42
+ # - This allows the calling application to store state information
43
+ # in these headers
44
+ # - Unless of course if the relevant header is input only and used
45
+ # for completing the request
46
+ # - In this case any remaining headers should be returned
47
+ # to the caller
48
+ # - If an error occurs trying to process the message, an error message
49
+ # must be sent back to the requesting application
50
+ # - If the reply fails, it must be put to the dead letter queue
51
+ # with the relevant dead letter header and reason
52
+ #
53
+ # Note: - It is not recommended to run server side MQ applications over a client
54
+ # connection.
55
+ # - Client connections require substantially more error handling.
56
+ # - E.g. Connection to queue manager can be lost due to netowk issues
57
+ # - Need to go into some sort of retry state attempting
58
+ # to reconnect to the queue manager
59
+ # - What about any work that was in progress?
60
+ # - Need to re-open any queues
61
+ # - Do any changes to other resources need to be undone first?
62
+ # - E.g. Database, File etc..
63
+ # - etc....
64
+ #
65
+ require 'wmq/wmq'
66
+
67
+ WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
68
+ qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:input) do |queue|
69
+ queue.each(:wait=>60000, :sync=>true, :convert=>true) do |request|
70
+ puts "Data Received:"
71
+ puts request.data
72
+
73
+ begin
74
+ reply = WMQ::Message.new
75
+ reply.data = 'Echo back:'+request.data
76
+
77
+ qmgr.put_to_reply_q(:message=>reply,
78
+ :request_message=>request, # Only replies if message type is request
79
+ :sync=>true)
80
+
81
+ rescue WMQ::WMQException => exc
82
+ # Failed to send reply, put message to the Dead Letter Queue and add a dead letter header
83
+ p exc
84
+ puts "Failed to reply to sender, Put to dead letter queue"
85
+ qmgr.put_to_dead_letter_q(:message=>request,
86
+ :reason=>WMQ::MQRC_UNKNOWN_REMOTE_Q_MGR,
87
+ :q_name=>queue.name,
88
+ :sync=>true)
89
+ # If it fails to put to the dead letter queue, this program will terminate and
90
+ # the changes will be "backed out". E.g. Queue Full, ...
91
+ end
92
+ qmgr.commit
93
+ end
94
+ end
95
+ puts 'No more messages found after 60 second wait interval'
96
+ end
data/lib/wmq/wmq.so ADDED
Binary file