rubywmq 0.3.0-i386-mswin32-mq6

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.html +6300 -0
  4. data/doc/classes/WMQ/Message.html +376 -0
  5. data/doc/classes/WMQ/Message.src/M000001.html +77 -0
  6. data/doc/classes/WMQ/Message.src/M000002.html +27 -0
  7. data/doc/classes/WMQ/Queue.html +1459 -0
  8. data/doc/classes/WMQ/Queue.src/M000003.html +205 -0
  9. data/doc/classes/WMQ/Queue.src/M000004.html +107 -0
  10. data/doc/classes/WMQ/Queue.src/M000005.html +198 -0
  11. data/doc/classes/WMQ/Queue.src/M000006.html +66 -0
  12. data/doc/classes/WMQ/Queue.src/M000007.html +203 -0
  13. data/doc/classes/WMQ/Queue.src/M000008.html +265 -0
  14. data/doc/classes/WMQ/Queue.src/M000009.html +120 -0
  15. data/doc/classes/WMQ/Queue.src/M000010.html +28 -0
  16. data/doc/classes/WMQ/Queue.src/M000011.html +30 -0
  17. data/doc/classes/WMQ/Queue.src/M000012.html +31 -0
  18. data/doc/classes/WMQ/Queue.src/M000013.html +31 -0
  19. data/doc/classes/WMQ/Queue.src/M000014.html +31 -0
  20. data/doc/classes/WMQ/QueueManager.html +1529 -0
  21. data/doc/classes/WMQ/QueueManager.src/M000015.html +182 -0
  22. data/doc/classes/WMQ/QueueManager.src/M000016.html +194 -0
  23. data/doc/classes/WMQ/QueueManager.src/M000017.html +92 -0
  24. data/doc/classes/WMQ/QueueManager.src/M000018.html +70 -0
  25. data/doc/classes/WMQ/QueueManager.src/M000019.html +49 -0
  26. data/doc/classes/WMQ/QueueManager.src/M000020.html +49 -0
  27. data/doc/classes/WMQ/QueueManager.src/M000021.html +63 -0
  28. data/doc/classes/WMQ/QueueManager.src/M000022.html +61 -0
  29. data/doc/classes/WMQ/QueueManager.src/M000023.html +65 -0
  30. data/doc/classes/WMQ/QueueManager.src/M000024.html +232 -0
  31. data/doc/classes/WMQ/QueueManager.src/M000025.html +30 -0
  32. data/doc/classes/WMQ/QueueManager.src/M000026.html +31 -0
  33. data/doc/classes/WMQ/QueueManager.src/M000027.html +31 -0
  34. data/doc/classes/WMQ/QueueManager.src/M000028.html +38 -0
  35. data/doc/classes/WMQ/QueueManager.src/M000029.html +33 -0
  36. data/doc/classes/WMQ/QueueManager.src/M000030.html +21 -0
  37. data/doc/classes/WMQ/QueueManager.src/M000031.html +284 -0
  38. data/doc/classes/WMQ/QueueManager.src/M000032.html +24 -0
  39. data/doc/classes/WMQ/QueueManager.src/M000033.html +18 -0
  40. data/doc/classes/WMQ/QueueManager.src/M000034.html +46 -0
  41. data/doc/classes/WMQ/QueueManager.src/M000035.html +27 -0
  42. data/doc/classes/WMQ/WMQException.html +111 -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.rb +25 -0
  79. data/lib/wmq/wmq.so +0 -0
  80. data/lib/wmq/wmq_const.rb +745 -0
  81. data/lib/wmq/wmq_const_admin.rb +555 -0
  82. data/lib/wmq/wmq_temp.rb +197 -0
  83. data/tests/test.rb +299 -0
  84. metadata +131 -0
@@ -0,0 +1,120 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>each (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * For each message found on the queue, the supplied block is executed
15
+ *
16
+ * Note:
17
+ * * If no messages are found on the queue during the supplied wait interval,
18
+ * then the supplied block will not be called at all
19
+ * * If :mode=&gt;:browse is supplied when opening the queue then Queue#each will automatically
20
+ * set MQGMO_BROWSE_FIRST and MQGMO_BROWSE_NEXT as required
21
+ *
22
+ * Returns:
23
+ * * true: If at least one message was succesfully processed
24
+ * * false: If no messages were retrieved from the queue
25
+ *
26
+ * Example:
27
+ * require 'wmq/wmq'
28
+ *
29
+ * WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID') do |qmgr|
30
+ * qmgr.open_queue(:q_name=&gt;'TEST.QUEUE', :mode=&gt;:input) do |queue|
31
+ * queue.each do |message|
32
+ * puts &quot;Data Received: #{message.data}&quot;
33
+ * end
34
+ * end
35
+ * puts 'Completed.'
36
+ * end
37
+ */
38
+ VALUE Queue_each(int argc, VALUE *argv, VALUE self)
39
+ {
40
+ VALUE message = Qnil;
41
+ VALUE match = Qnil;
42
+ VALUE options = Qnil;
43
+ VALUE result = Qfalse;
44
+ VALUE proc, hash;
45
+ MQLONG browse = 0;
46
+
47
+ PQUEUE pq;
48
+ Data_Get_Struct(self, QUEUE, pq);
49
+
50
+ /* Extract parameters and code block (Proc) */
51
+ rb_scan_args(argc, argv, &quot;01&amp;&quot;, &amp;hash, &amp;proc);
52
+
53
+ if(NIL_P(hash))
54
+ {
55
+ hash = rb_hash_new();
56
+ }
57
+ else
58
+ {
59
+ message = rb_hash_aref(hash, ID2SYM(ID_message));
60
+ match = rb_hash_aref(hash, ID2SYM(ID_match));
61
+ options = rb_hash_aref(hash, ID2SYM(ID_options));
62
+ }
63
+
64
+ if (NIL_P(message))
65
+ {
66
+ message = rb_funcall(wmq_message, ID_new, 0);
67
+ rb_hash_aset(hash, ID2SYM(ID_message), message);
68
+ }
69
+
70
+ if (NIL_P(match))
71
+ {
72
+ rb_hash_aset(hash, ID2SYM(ID_match), LONG2NUM(MQMO_NONE));
73
+ }
74
+
75
+ /* If queue is open for browse, set Borwse first indicator */
76
+ if(pq-&gt;open_options &amp; MQOO_BROWSE)
77
+ {
78
+ MQLONG get_options;
79
+ if(NIL_P(options))
80
+ {
81
+ get_options = MQGMO_BROWSE_FIRST;
82
+ }
83
+ else
84
+ {
85
+ get_options = NUM2LONG(options) | MQGMO_BROWSE_FIRST;
86
+ }
87
+ rb_hash_aset(hash, ID2SYM(ID_options), LONG2NUM(get_options));
88
+
89
+ if(pq-&gt;trace_level&gt;1) printf(&quot;WMQ::Queue#each MQGMO_BROWSE_FIRST set, get options:%ld\n&quot;, get_options);
90
+ browse = 1;
91
+ }
92
+
93
+ while(Queue_get(self, hash))
94
+ {
95
+ result = Qtrue;
96
+
97
+ /* Call code block passing in message */
98
+ rb_funcall( proc, ID_call, 1, message );
99
+
100
+ if(browse)
101
+ {
102
+ MQLONG get_options;
103
+ if(NIL_P(options))
104
+ {
105
+ get_options = MQGMO_BROWSE_NEXT;
106
+ }
107
+ else
108
+ {
109
+ get_options = (NUM2LONG(options) - MQGMO_BROWSE_FIRST) | MQGMO_BROWSE_NEXT;
110
+ }
111
+ rb_hash_aset(hash, ID2SYM(ID_options), LONG2NUM(get_options));
112
+
113
+ if(pq-&gt;trace_level&gt;1) printf(&quot;WMQ::Queue#each MQGMO_BROWSE_NEXT set, get options:%ld\n&quot;, get_options);
114
+ }
115
+ }
116
+
117
+ return result;
118
+ }</pre>
119
+ </body>
120
+ </html>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>name (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns the queue name =&gt; String
15
+ */
16
+ VALUE Queue_name(VALUE self)
17
+ {
18
+ /* If Queue is open, return opened name, otherwise return original name */
19
+ PQUEUE pq;
20
+ Data_Get_Struct(self, QUEUE, pq);
21
+ if (pq-&gt;hobj)
22
+ {
23
+ return rb_iv_get(self,&quot;@name&quot;);
24
+ }
25
+ return rb_iv_get(self,&quot;@original_name&quot;);
26
+ }</pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>comp_code (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Return the completion code for the last MQ operation on this queue instance
15
+ *
16
+ * Returns =&gt; FixNum
17
+ * * WMQ::MQCC_OK 0
18
+ * * WMQ::MQCC_WARNING 1
19
+ * * WMQ::MQCC_FAILED 2
20
+ * * WMQ::MQCC_UNKNOWN -1
21
+ *
22
+ */
23
+ VALUE Queue_comp_code(VALUE self)
24
+ {
25
+ PQUEUE pq;
26
+ Data_Get_Struct(self, QUEUE, pq);
27
+ return LONG2NUM(pq-&gt;comp_code);
28
+ }</pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>reason_code (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Return the reason code for the last MQ operation on this queue instance
15
+ *
16
+ * Returns =&gt; FixNum
17
+ * * For a complete list of reason codes, please see WMQ Constants or
18
+ * the WebSphere MQ documentation for Reason Codes
19
+ *
20
+ * Note
21
+ * * The list of Reason Codes varies depending on the version of WebSphere MQ
22
+ * and the operating system on which Ruby WMQ was compiled
23
+ */
24
+ VALUE Queue_reason_code(VALUE self)
25
+ {
26
+ PQUEUE pq;
27
+ Data_Get_Struct(self, QUEUE, pq);
28
+ return LONG2NUM(pq-&gt;reason_code);
29
+ }</pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>reason (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns a textual representation of the reason_code for the last MQ operation on this queue instance
15
+ *
16
+ * Returns =&gt; String
17
+ * * For a complete list of reasons, please see WMQ Constants or
18
+ * the WebSphere MQ documentation for Reason Codes
19
+ *
20
+ * Note
21
+ * * The list of Reason Codes varies depending on the version of WebSphere MQ
22
+ * and the operating system on which Ruby WMQ was compiled
23
+ */
24
+ VALUE Queue_reason(VALUE self)
25
+ {
26
+ PQUEUE pq;
27
+ Data_Get_Struct(self, QUEUE, pq);
28
+ return rb_str_new2(wmq_reason(pq-&gt;reason_code));
29
+ }</pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>open? (WMQ::Queue)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns whether this queue is currently open
15
+ *
16
+ * Returns:
17
+ * * true : The queue is open
18
+ * * false: The queue is _not_ open
19
+ */
20
+ VALUE Queue_open_q(VALUE self)
21
+ {
22
+ PQUEUE pq;
23
+ Data_Get_Struct(self, QUEUE, pq);
24
+ if (pq-&gt;hobj)
25
+ {
26
+ return Qtrue;
27
+ }
28
+ return Qfalse;
29
+ }</pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,1529 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: WMQ::QueueManager</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">WMQ::QueueManager</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/ext/wmq_c.html">
59
+ ext/wmq.c
60
+ </a>
61
+ <br />
62
+ <a href="../../files/ext/lib/wmq_temp_rb.html">
63
+ ext/lib/wmq_temp.rb
64
+ </a>
65
+ <br />
66
+ </td>
67
+ </tr>
68
+
69
+ <tr class="top-aligned-row">
70
+ <td><strong>Parent:</strong></td>
71
+ <td>
72
+ Object
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ <!-- banner header -->
78
+
79
+ <div id="bodyContent">
80
+
81
+
82
+
83
+ <div id="contextContent">
84
+
85
+
86
+
87
+ </div>
88
+
89
+ <div id="method-list">
90
+ <h3 class="section-bar">Methods</h3>
91
+
92
+ <div class="name-list">
93
+ <a href="#M000020">access_queue</a>&nbsp;&nbsp;
94
+ <a href="#M000023">backout</a>&nbsp;&nbsp;
95
+ <a href="#M000021">begin</a>&nbsp;&nbsp;
96
+ <a href="#M000022">commit</a>&nbsp;&nbsp;
97
+ <a href="#M000025">comp_code</a>&nbsp;&nbsp;
98
+ <a href="#M000015">connect</a>&nbsp;&nbsp;
99
+ <a href="#M000017">connect</a>&nbsp;&nbsp;
100
+ <a href="#M000029">connected?</a>&nbsp;&nbsp;
101
+ <a href="#M000018">disconnect</a>&nbsp;&nbsp;
102
+ <a href="#M000028">exception_on_error</a>&nbsp;&nbsp;
103
+ <a href="#M000031">execute</a>&nbsp;&nbsp;
104
+ <a href="#M000032">method_missing</a>&nbsp;&nbsp;
105
+ <a href="#M000033">mqsc</a>&nbsp;&nbsp;
106
+ <a href="#M000030">name</a>&nbsp;&nbsp;
107
+ <a href="#M000016">new</a>&nbsp;&nbsp;
108
+ <a href="#M000019">open_queue</a>&nbsp;&nbsp;
109
+ <a href="#M000024">put</a>&nbsp;&nbsp;
110
+ <a href="#M000035">put_to_dead_letter_q</a>&nbsp;&nbsp;
111
+ <a href="#M000034">put_to_reply_q</a>&nbsp;&nbsp;
112
+ <a href="#M000027">reason</a>&nbsp;&nbsp;
113
+ <a href="#M000026">reason_code</a>&nbsp;&nbsp;
114
+ </div>
115
+ </div>
116
+
117
+ </div>
118
+
119
+
120
+ <!-- if includes -->
121
+
122
+ <div id="section">
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <!-- if method_list -->
132
+ <div id="methods">
133
+ <h3 class="section-bar">Public Class methods</h3>
134
+
135
+ <div id="method-M000015" class="method-detail">
136
+ <a name="M000015"></a>
137
+
138
+ <div class="method-heading">
139
+ <a href="QueueManager.src/M000015.html" target="Code" class="method-signature"
140
+ onclick="popupCode('QueueManager.src/M000015.html');return false;">
141
+ <span class="method-name">connect(...)<br />
142
+ </span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ <p>
148
+ Connect to the queue manager, then disconnect once the supplied code block
149
+ completes
150
+ </p>
151
+ <p>
152
+ Parameters:
153
+ </p>
154
+ <ul>
155
+ <li>Since the number of parameters can vary dramatically, all parameters are
156
+ passed by name in a hash
157
+
158
+ </li>
159
+ <li>Summary of parameters and their WebSphere MQ equivalents:
160
+
161
+ </li>
162
+ </ul>
163
+ <pre>
164
+ WMQ::QueueManager.connect( # WebSphere MQ Equivalents:
165
+ :q_mgr_name =&gt; 'queue_manager name',
166
+ :exception_on_error =&gt; true, # n/a
167
+ :connect_options =&gt; WMQ::MQCNO_FASTBATH_BINDING # MQCNO.Options
168
+
169
+ :trace_level =&gt; 0, # n/a
170
+
171
+ # Common client connection parameters
172
+ :channel_name =&gt; 'svrconn channel name', # MQCD.ChannelName
173
+ :connection_name =&gt; 'localhost(1414)', # MQCD.ConnectionName
174
+ :transport_type =&gt; WMQ::MQXPT_TCP, # MQCD.TransportType
175
+
176
+ # Advanced client connections parameters
177
+ :max_msg_length =&gt; 65535, # MQCD.MaxMsgLength
178
+ :security_exit =&gt; 'Name of security exit', # MQCD.SecurityExit
179
+ :send_exit =&gt; 'Name of send exit', # MQCD.SendExit
180
+ :receive_exit =&gt; 'Name of receive exit', # MQCD.ReceiveExit
181
+ :security_user_data =&gt; 'Security exit User data', # MQCD.SecurityUserData
182
+ :send_user_data =&gt; 'Send exit user data', # MQCD.SendUserData
183
+ :receive_user_data =&gt; 'Receive exit user data', # MQCD.ReceiveUserData
184
+ :heartbeat_interval =&gt; 1, # MQCD.HeartbeatInterval
185
+ :remote_security_id =&gt; 'Remote Security id', # MQCD.RemoteSecurityId
186
+ :ssl_cipher_spec =&gt; 'SSL Cipher Spec', # MQCD.SSLCipherSpec
187
+ :keep_alive_interval=&gt; -1, # MQCD.KeepAliveInterval
188
+ :mode_name =&gt; 'LU6.2 Mode Name', # MQCD.ModeName
189
+ :tp_name =&gt; 'LU6.2 Transaction pgm name', # MQCD.TpName
190
+ :user_identifier =&gt; 'LU 6.2 Userid', # MQCD.UserIdentifier
191
+ :password =&gt; 'LU6.2 Password', # MQCD.Password
192
+ :long_remote_user_id=&gt; 'Long remote user identifier', # MQCD.LongRemoteUserId (Ptr, Length)
193
+ :ssl_peer_name =&gt; 'SSL Peer name', # MQCD.SSLPeerName (Ptr, Length)
194
+
195
+ # SSL Options
196
+ :key_repository =&gt; '/var/mqm/qmgrs/.../key', # MQSCO.KeyRepository
197
+ :crypto_hardware =&gt; 'GSK_ACCELERATOR_NCIPHER_NF_ON', # MQSCO.CryptoHardware
198
+ )
199
+ </pre>
200
+ <p>
201
+ Optional Parameters
202
+ </p>
203
+ <ul>
204
+ <li>:q_mgr_name =&gt; String
205
+
206
+ <ul>
207
+ <li>Name of the existing WebSphere MQ <a href="Queue.html">Queue</a> Manager to
208
+ connect to
209
+
210
+ </li>
211
+ <li>Default:
212
+
213
+ <pre>
214
+ - Server connections will connect to the default queue manager
215
+ - Client connections will connect to whatever queue
216
+ manager is found at the host and port number as specified
217
+ by the connection_name
218
+ </pre>
219
+ </li>
220
+ </ul>
221
+ </li>
222
+ <li>:<a href="QueueManager.html#M000028">exception_on_error</a> =&gt; true or
223
+ false
224
+
225
+ <pre>
226
+ Determines whether WMQ::WMQExceptions are thrown whenever
227
+ an error occurs during a WebSphere MQ operation (connect, put, get, etc..)
228
+
229
+ Default: true
230
+ </pre>
231
+ </li>
232
+ <li>:connect_options =&gt; FixNum
233
+
234
+ <ul>
235
+ <li>One or more of the following values:
236
+
237
+ <pre>
238
+ WMQ::MQCNO_STANDARD_BINDING
239
+ WMQ::MQCNO_FASTPATH_BINDING
240
+ WMQ::MQCNO_SHARED_BINDING
241
+ WMQ::MQCNO_ISOLATED_BINDING
242
+ WMQ::MQCNO_ACCOUNTING_MQI_ENABLED
243
+ WMQ::MQCNO_ACCOUNTING_MQI_DISABLED
244
+ WMQ::MQCNO_ACCOUNTING_Q_ENABLED
245
+ WMQ::MQCNO_ACCOUNTING_Q_DISABLED
246
+ WMQ::MQCNO_NONE
247
+ </pre>
248
+ </li>
249
+ <li>Multiple values can be or&#8217;d together. E.g.
250
+
251
+ <pre>
252
+ :connect_options=&gt;WMQ::MQCNO_FASTPATH_BINDING | WMQ::MQCNO_ACCOUNTING_MQI_ENABLED
253
+ </pre>
254
+ </li>
255
+ <li>Please see the WebSphere MQ MQCNO data type documentation for more details
256
+
257
+ <pre>
258
+ Default: WMQ::MQCNO_NONE
259
+ </pre>
260
+ </li>
261
+ </ul>
262
+ </li>
263
+ <li>:trace_level =&gt; FixNum
264
+
265
+ <ul>
266
+ <li>Turns on low-level tracing of the WebSphere MQ API calls to stdout.
267
+
268
+ <ul>
269
+ <li>0: No tracing
270
+
271
+ </li>
272
+ <li>1: MQ API tracing only (MQCONNX, MQOPEN, MQPUT, etc..)
273
+
274
+ </li>
275
+ <li>2: Include Ruby <a href="../WMQ.html">WMQ</a> tracing
276
+
277
+ </li>
278
+ <li>3: Verbose logging (Recommended for when reporting problems in Ruby <a
279
+ href="../WMQ.html">WMQ</a>)
280
+
281
+ </li>
282
+ </ul>
283
+ <pre>
284
+ Default: 0
285
+ </pre>
286
+ </li>
287
+ </ul>
288
+ </li>
289
+ </ul>
290
+ <p>
291
+ Common Client Connection Parameters (Client connections only)
292
+ </p>
293
+ <ul>
294
+ <li>:connection_name =&gt; String (Mandatory for client connections)
295
+
296
+ <ul>
297
+ <li>Connection name, made up of the host name (or ip address) and the port
298
+ number
299
+
300
+ </li>
301
+ <li>E.g.
302
+
303
+ <pre>
304
+ 'mymachine.domain.com(1414)'
305
+ '192.168.0.1(1417)'
306
+ </pre>
307
+ </li>
308
+ </ul>
309
+ </li>
310
+ <li>:channel_name =&gt; String
311
+
312
+ <ul>
313
+ <li>Name of SVRCONN channel defined on the <a
314
+ href="QueueManager.html">QueueManager</a> for Client Connections
315
+
316
+ </li>
317
+ <li>Default Value:
318
+
319
+ <pre>
320
+ 'SYSTEM.DEF.SVRCONN'
321
+ </pre>
322
+ </li>
323
+ </ul>
324
+ </li>
325
+ <li>:transport_type =&gt; WMQ::MQXPT_TCP, # MQCD.TransportType
326
+
327
+ <ul>
328
+ <li>Valid Values:
329
+
330
+ <pre>
331
+ WMQ::MQXPT_LOCAL
332
+ WMQ::MQXPT_LU62
333
+ WMQ::MQXPT_TCP
334
+ WMQ::MQXPT_NETBIOS
335
+ WMQ::MQXPT_SPX
336
+ WMQ::MQXPT_DECNET
337
+ WMQ::MQXPT_UDP
338
+ </pre>
339
+ </li>
340
+ <li>Default Value:
341
+
342
+ <pre>
343
+ WMQ::MQXPT_TCP
344
+ </pre>
345
+ </li>
346
+ </ul>
347
+ </li>
348
+ </ul>
349
+ <p>
350
+ For the Advanced Client Connection parameters, please see the WebSphere MQ
351
+ documentation
352
+ </p>
353
+ <p>
354
+ Note:
355
+ </p>
356
+ <ul>
357
+ <li>If an exception is not caught in the code block, the current unit of work
358
+ is automatically backed out, before disconnecting from the queue manager.
359
+
360
+ </li>
361
+ </ul>
362
+ <p>
363
+ Local Server Connection Example:
364
+ </p>
365
+ <pre>
366
+ require 'wmq/wmq'
367
+
368
+ WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID') do |qmgr|
369
+ qmgr.put(:q_name=&gt;'TEST.QUEUE', :data =&gt; 'Hello World')
370
+ end
371
+ </pre>
372
+ <p>
373
+ Client Connection Example:
374
+ </p>
375
+ <pre>
376
+ require 'wmq/wmq_client'
377
+
378
+ WMQ::QueueManager.connect(
379
+ :channel_name =&gt; 'SYSTEM.DEF.SVRCONN',
380
+ :transport_type =&gt; WMQ::MQXPT_TCP,
381
+ :connection_name =&gt; 'localhost(1414)' ) do |qmgr|
382
+ qmgr.open_queue(:q_name=&gt;'TEST.QUEUE', :mode=&gt;:input) do |queue|
383
+
384
+ message = WMQ::Message.new
385
+ if queue.get(:message =&gt; message)
386
+ puts &quot;Data Received: #{message.data}&quot;
387
+ else
388
+ puts 'No message available'
389
+ end
390
+ end
391
+ end
392
+ </pre>
393
+ </div>
394
+ </div>
395
+
396
+ <div id="method-M000016" class="method-detail">
397
+ <a name="M000016"></a>
398
+
399
+ <div class="method-heading">
400
+ <a href="QueueManager.src/M000016.html" target="Code" class="method-signature"
401
+ onclick="popupCode('QueueManager.src/M000016.html');return false;">
402
+ <span class="method-name">new(...)<br />
403
+ </span>
404
+ </a>
405
+ </div>
406
+
407
+ <div class="method-description">
408
+ <p>
409
+ Parameters:
410
+ </p>
411
+ <ul>
412
+ <li>Since the number of parameters can vary dramatically, all parameters are
413
+ passed by name in a hash
414
+
415
+ </li>
416
+ <li>See <a href="QueueManager.html#M000016">QueueManager.new</a> for details on
417
+ all the parameters
418
+
419
+ </li>
420
+ </ul>
421
+ <p>
422
+ Note:
423
+ </p>
424
+ <ul>
425
+ <li>It is not recommended to use this method, rather use <a
426
+ href="QueueManager.html#M000015">QueueManager.connect</a>, since it will
427
+ automatically disconnect from the queue manager. It also deals with backing
428
+ out the current unit of work in the event of an unhandled exception. E.g.
429
+ Syntax Error
430
+
431
+ </li>
432
+ <li>RuntimeError and ArgumentError exceptions are always thrown regardless of
433
+ the value of :<a href="QueueManager.html#M000028">exception_on_error</a>
434
+
435
+ </li>
436
+ </ul>
437
+ <p>
438
+ Todo:
439
+ </p>
440
+ <ul>
441
+ <li>Support multiple send and receive exits
442
+
443
+ </li>
444
+ </ul>
445
+ </div>
446
+ </div>
447
+
448
+ <h3 class="section-bar">Public Instance methods</h3>
449
+
450
+ <div id="method-M000020" class="method-detail">
451
+ <a name="M000020"></a>
452
+
453
+ <div class="method-heading">
454
+ <a href="QueueManager.src/M000020.html" target="Code" class="method-signature"
455
+ onclick="popupCode('QueueManager.src/M000020.html');return false;">
456
+ <span class="method-name">open_queue(...)<br />
457
+ access_queue(...)<br />
458
+ </span>
459
+ </a>
460
+ </div>
461
+
462
+ <div class="method-description">
463
+ <p>
464
+ Open the specified queue, then close it once the supplied code block has
465
+ completed
466
+ </p>
467
+ <p>
468
+ Parameters:
469
+ </p>
470
+ <ul>
471
+ <li>Since the number of parameters can vary dramatically, all parameters are
472
+ passed by name in a hash
473
+
474
+ </li>
475
+ <li>See <a href="Queue.html#M000003">Queue.open</a> for the complete list of
476
+ parameters, except that :queue_manager is <b>not</b> required since it is
477
+ supplied automatically by this method
478
+
479
+ </li>
480
+ </ul>
481
+ <p>
482
+ Example:
483
+ </p>
484
+ <pre>
485
+ require 'wmq/wmq_client'
486
+
487
+ WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID', :connection_name=&gt;'localhost(1414)') do |qmgr|
488
+ qmgr.open_queue(:q_name=&gt;'TEST.QUEUE', :mode=&gt;:output) do |queue|
489
+ queue.put(:data =&gt; 'Hello World')
490
+ end
491
+ end
492
+ </pre>
493
+ </div>
494
+ </div>
495
+
496
+ <div id="method-M000023" class="method-detail">
497
+ <a name="M000023"></a>
498
+
499
+ <div class="method-heading">
500
+ <a href="QueueManager.src/M000023.html" target="Code" class="method-signature"
501
+ onclick="popupCode('QueueManager.src/M000023.html');return false;">
502
+ <span class="method-name">backout</span><span class="method-args">()</span>
503
+ </a>
504
+ </div>
505
+
506
+ <div class="method-description">
507
+ <p>
508
+ Backout the current unit of work for this <a
509
+ href="QueueManager.html">QueueManager</a> instance
510
+ </p>
511
+ <p>
512
+ Since the last commit or rollback any messages put to a queue under
513
+ synchpoint will be removed and any messages retrieved under synchpoint from
514
+ any queues will be returned
515
+ </p>
516
+ <p>
517
+ Note:
518
+ </p>
519
+ <ul>
520
+ <li>backout will have no effect if all put and get operations were performed
521
+ without specifying :sync =&gt; true
522
+
523
+ </li>
524
+ </ul>
525
+ <p>
526
+ Returns:
527
+ </p>
528
+ <ul>
529
+ <li>true : On Success
530
+
531
+ </li>
532
+ <li>false: On Failure
533
+
534
+ <p>
535
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
536
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
537
+ will return a text description of the <a
538
+ href="QueueManager.html#M000026">reason_code</a>
539
+ </p>
540
+ </li>
541
+ </ul>
542
+ <p>
543
+ Throws:
544
+ </p>
545
+ <ul>
546
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
547
+ href="QueueManager.html#M000025">comp_code</a> != MQCC_OK
548
+
549
+ </li>
550
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
551
+ false was supplied as a parameter to <a
552
+ href="QueueManager.html#M000016">QueueManager.new</a>
553
+
554
+ </li>
555
+ </ul>
556
+ </div>
557
+ </div>
558
+
559
+ <div id="method-M000021" class="method-detail">
560
+ <a name="M000021"></a>
561
+
562
+ <div class="method-heading">
563
+ <a href="QueueManager.src/M000021.html" target="Code" class="method-signature"
564
+ onclick="popupCode('QueueManager.src/M000021.html');return false;">
565
+ <span class="method-name">begin</span><span class="method-args">()</span>
566
+ </a>
567
+ </div>
568
+
569
+ <div class="method-description">
570
+ <p>
571
+ Advanced WebSphere MQ Use:
572
+ </p>
573
+ <p>
574
+ Begin a unit of work between this <a
575
+ href="QueueManager.html">QueueManager</a> instance and another resource
576
+ such as a Database
577
+ </p>
578
+ <p>
579
+ Starts a new unit of work under which put and get can be called with with
580
+ the parameter :sync =&gt; true
581
+ </p>
582
+ <p>
583
+ Returns:
584
+ </p>
585
+ <ul>
586
+ <li>true : On Success
587
+
588
+ </li>
589
+ <li>false: On Failure
590
+
591
+ <p>
592
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
593
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
594
+ will return a text description of the <a
595
+ href="QueueManager.html#M000026">reason_code</a>
596
+ </p>
597
+ </li>
598
+ </ul>
599
+ <p>
600
+ Throws:
601
+ </p>
602
+ <ul>
603
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
604
+ href="QueueManager.html#M000025">comp_code</a> != MQCC_OK
605
+
606
+ </li>
607
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
608
+ false was supplied as a parameter to <a
609
+ href="QueueManager.html#M000016">QueueManager.new</a>
610
+
611
+ </li>
612
+ </ul>
613
+ </div>
614
+ </div>
615
+
616
+ <div id="method-M000022" class="method-detail">
617
+ <a name="M000022"></a>
618
+
619
+ <div class="method-heading">
620
+ <a href="QueueManager.src/M000022.html" target="Code" class="method-signature"
621
+ onclick="popupCode('QueueManager.src/M000022.html');return false;">
622
+ <span class="method-name">commit</span><span class="method-args">()</span>
623
+ </a>
624
+ </div>
625
+
626
+ <div class="method-description">
627
+ <p>
628
+ Commit the current unit of work for this <a
629
+ href="QueueManager.html">QueueManager</a> instance
630
+ </p>
631
+ <p>
632
+ Note:
633
+ </p>
634
+ <ul>
635
+ <li>commit will have no effect if all put and get operations were performed
636
+ without specifying :sync =&gt; true
637
+
638
+ </li>
639
+ </ul>
640
+ <p>
641
+ Returns:
642
+ </p>
643
+ <ul>
644
+ <li>true : On Success
645
+
646
+ </li>
647
+ <li>false: On Failure
648
+
649
+ <p>
650
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
651
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
652
+ will return a text description of the <a
653
+ href="QueueManager.html#M000026">reason_code</a>
654
+ </p>
655
+ </li>
656
+ </ul>
657
+ <p>
658
+ Throws:
659
+ </p>
660
+ <ul>
661
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
662
+ href="QueueManager.html#M000025">comp_code</a> != MQCC_OK
663
+
664
+ </li>
665
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
666
+ false was supplied as a parameter to <a
667
+ href="QueueManager.html#M000016">QueueManager.new</a>
668
+
669
+ </li>
670
+ </ul>
671
+ </div>
672
+ </div>
673
+
674
+ <div id="method-M000025" class="method-detail">
675
+ <a name="M000025"></a>
676
+
677
+ <div class="method-heading">
678
+ <a href="QueueManager.src/M000025.html" target="Code" class="method-signature"
679
+ onclick="popupCode('QueueManager.src/M000025.html');return false;">
680
+ <span class="method-name">comp_code</span><span class="method-args">()</span>
681
+ </a>
682
+ </div>
683
+
684
+ <div class="method-description">
685
+ <p>
686
+ Return the completion code for the last MQ operation
687
+ </p>
688
+ <p>
689
+ Returns =&gt; FixNum
690
+ </p>
691
+ <ul>
692
+ <li>WMQ::MQCC_OK 0
693
+
694
+ </li>
695
+ <li>WMQ::MQCC_WARNING 1
696
+
697
+ </li>
698
+ <li>WMQ::MQCC_FAILED 2
699
+
700
+ </li>
701
+ <li>WMQ::MQCC_UNKNOWN -1
702
+
703
+ </li>
704
+ </ul>
705
+ </div>
706
+ </div>
707
+
708
+ <div id="method-M000017" class="method-detail">
709
+ <a name="M000017"></a>
710
+
711
+ <div class="method-heading">
712
+ <a href="QueueManager.src/M000017.html" target="Code" class="method-signature"
713
+ onclick="popupCode('QueueManager.src/M000017.html');return false;">
714
+ <span class="method-name">connect</span><span class="method-args">()</span>
715
+ </a>
716
+ </div>
717
+
718
+ <div class="method-description">
719
+ <p>
720
+ Before working with any queues, it is necessary to connect to the queue
721
+ manager.
722
+ </p>
723
+ <p>
724
+ Returns:
725
+ </p>
726
+ <ul>
727
+ <li>true : On Success
728
+
729
+ </li>
730
+ <li>false: On Failure
731
+
732
+ <p>
733
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
734
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
735
+ will return a text description of the <a
736
+ href="QueueManager.html#M000026">reason_code</a>
737
+ </p>
738
+ </li>
739
+ </ul>
740
+ <p>
741
+ Throws:
742
+ </p>
743
+ <ul>
744
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
745
+ href="QueueManager.html#M000025">comp_code</a> != MQCC_OK
746
+
747
+ </li>
748
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
749
+ false was supplied as a parameter to <a
750
+ href="QueueManager.html#M000016">QueueManager.new</a>
751
+
752
+ </li>
753
+ </ul>
754
+ </div>
755
+ </div>
756
+
757
+ <div id="method-M000029" class="method-detail">
758
+ <a name="M000029"></a>
759
+
760
+ <div class="method-heading">
761
+ <a href="QueueManager.src/M000029.html" target="Code" class="method-signature"
762
+ onclick="popupCode('QueueManager.src/M000029.html');return false;">
763
+ <span class="method-name">connected?</span><span class="method-args">()</span>
764
+ </a>
765
+ </div>
766
+
767
+ <div class="method-description">
768
+ <p>
769
+ Returns whether this <a href="QueueManager.html">QueueManager</a> instance
770
+ is currently connected to a WebSphere MQ queue manager
771
+ </p>
772
+ <p>
773
+ Returns:
774
+ </p>
775
+ <ul>
776
+ <li>true : This <a href="QueueManager.html">QueueManager</a> instance is
777
+ connected to a local or remote queue manager
778
+
779
+ </li>
780
+ <li>false: This <a href="QueueManager.html">QueueManager</a> instance is not
781
+ currently connected to a local or remote queue manager
782
+
783
+ </li>
784
+ </ul>
785
+ </div>
786
+ </div>
787
+
788
+ <div id="method-M000018" class="method-detail">
789
+ <a name="M000018"></a>
790
+
791
+ <div class="method-heading">
792
+ <a href="QueueManager.src/M000018.html" target="Code" class="method-signature"
793
+ onclick="popupCode('QueueManager.src/M000018.html');return false;">
794
+ <span class="method-name">disconnect</span><span class="method-args">()</span>
795
+ </a>
796
+ </div>
797
+
798
+ <div class="method-description">
799
+ <p>
800
+ Disconnect from this <a href="QueueManager.html">QueueManager</a> instance
801
+ </p>
802
+ <p>
803
+ Returns:
804
+ </p>
805
+ <ul>
806
+ <li>true : On Success
807
+
808
+ </li>
809
+ <li>false: On Failure
810
+
811
+ <p>
812
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
813
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
814
+ will return a text description of the <a
815
+ href="QueueManager.html#M000026">reason_code</a>
816
+ </p>
817
+ </li>
818
+ </ul>
819
+ <p>
820
+ Throws:
821
+ </p>
822
+ <ul>
823
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
824
+ href="QueueManager.html#M000025">comp_code</a> != MQCC_OK
825
+
826
+ </li>
827
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
828
+ false was supplied as a parameter to <a
829
+ href="QueueManager.html#M000016">QueueManager.new</a>
830
+
831
+ </li>
832
+ </ul>
833
+ </div>
834
+ </div>
835
+
836
+ <div id="method-M000028" class="method-detail">
837
+ <a name="M000028"></a>
838
+
839
+ <div class="method-heading">
840
+ <a href="QueueManager.src/M000028.html" target="Code" class="method-signature"
841
+ onclick="popupCode('QueueManager.src/M000028.html');return false;">
842
+ <span class="method-name">exception_on_error</span><span class="method-args">()</span>
843
+ </a>
844
+ </div>
845
+
846
+ <div class="method-description">
847
+ <p>
848
+ Returns whether this <a href="QueueManager.html">QueueManager</a> instance
849
+ is set to throw a <a href="WMQException.html">WMQ::WMQException</a>
850
+ whenever an MQ operation fails
851
+ </p>
852
+ <p>
853
+ Returns:
854
+ </p>
855
+ <ul>
856
+ <li>true : This <a href="QueueManager.html">QueueManager</a> instance will
857
+ throw a <a href="WMQException.html">WMQ::WMQException</a> whenever an MQ
858
+ operation fails. I.e. if <a href="QueueManager.html#M000025">comp_code</a>
859
+ != WMQ::OK.
860
+
861
+ </li>
862
+ <li>false: <a href="WMQException.html">WMQ::WMQException</a> will not be thrown
863
+
864
+ </li>
865
+ </ul>
866
+ <p>
867
+ Note:
868
+ </p>
869
+ <ul>
870
+ <li>RuntimeError and ArgumentError exceptions are always thrown regardless of
871
+ the value of <a href="QueueManager.html#M000028">exception_on_error</a>
872
+
873
+ </li>
874
+ </ul>
875
+ </div>
876
+ </div>
877
+
878
+ <div id="method-M000031" class="method-detail">
879
+ <a name="M000031"></a>
880
+
881
+ <div class="method-heading">
882
+ <a href="QueueManager.src/M000031.html" target="Code" class="method-signature"
883
+ onclick="popupCode('QueueManager.src/M000031.html');return false;">
884
+ <span class="method-name">execute(...)<br />
885
+ </span>
886
+ </a>
887
+ </div>
888
+
889
+ <div class="method-description">
890
+ <p>
891
+ Execute an Administration command against the local queue manager
892
+ </p>
893
+ <p>
894
+ Parameters:
895
+ </p>
896
+ <ul>
897
+ <li>Since the number of parameters can vary dramatically, all parameters are
898
+ passed by name in a hash
899
+
900
+ </li>
901
+ <li>The entire MQ Administration interface has been implemented. Rather than
902
+ re-documentation the hundreds of options, a standard convention has been
903
+ used to map the MQ constants to Symbols in Ruby.
904
+
905
+ </li>
906
+ </ul>
907
+ <p>
908
+ For all MQ Admin commands, just drop the MQAI_ off the front and convert
909
+ the command name to lower case.
910
+ </p>
911
+ <ul>
912
+ <li>E.g. MQAI_INQUIRE_Q becomes inquire_q
913
+
914
+ </li>
915
+ </ul>
916
+ <p>
917
+ For the hundreds of parameters, a similiar technique is followed. Remove
918
+ the prefixes: MQCA_, MQIA_, etc.. and convert to lowercase
919
+ </p>
920
+ <ul>
921
+ <li>E.g. MQCA_Q_NAME becomes :q_name
922
+
923
+ </li>
924
+ </ul>
925
+ <p>
926
+ Example
927
+ </p>
928
+ <pre>
929
+ WMQ::QueueManager.connect do |qmgr|
930
+ result = qmgr.execute(
931
+ :command =&gt; :inquire_q,
932
+ :q_name =&gt; 'MY.LOCAL.QUEUE',
933
+ :q_type =&gt; WMQ::MQQT_LOCAL,
934
+ :current_q_depth =&gt; nil
935
+ )
936
+ # OR, we can replace the method name execute with the MQAI command:
937
+ result = qmgr.inquire_q(
938
+ :q_name =&gt; 'MY.LOCAL.QUEUE',
939
+ :q_type =&gt; WMQ::MQQT_LOCAL,
940
+ :current_q_depth =&gt; nil
941
+ )
942
+ </pre>
943
+ <p>
944
+ Complete Example:
945
+ </p>
946
+ <pre>
947
+ require 'wmq/wmq'
948
+ require 'wmq/wmq_const_admin'
949
+ WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID', :connection_name=&gt;'localhost(1414)') do |qmgr|
950
+ qmgr.reset_q_stats(:q_name=&gt;'*').each {|item| p item }
951
+ end
952
+ </pre>
953
+ <p>
954
+ Some one line examples
955
+ </p>
956
+ <pre>
957
+ qmgr.inquire_q(:q_name=&gt;'TEST*').each {|item| p item }
958
+
959
+ qmgr.inquire_q(:q_name=&gt;'TEST*', :q_type=&gt;WMQ::MQQT_LOCAL, :current_q_depth=&gt;nil).each {|item| p item }
960
+
961
+ qmgr.inquire_process(:process_name=&gt;'*').each {|item| p item }
962
+
963
+ qmgr.ping_q_mgr.each {|item| p item }
964
+
965
+ qmgr.refresh_security.each {|item| p item }
966
+
967
+ qmgr.inquire_q_status(:q_name=&gt;'TEST*', :q_status_type=&gt;:q_status, :q_status_attrs=&gt;:process_id).each {|item| p item }
968
+
969
+ qmgr.start_channel_listener.each {|item| p item }
970
+
971
+ qmgr.inquire_channel_status(:channel_name=&gt;'*').each {|item| p item }
972
+ </pre>
973
+ </div>
974
+ </div>
975
+
976
+ <div id="method-M000032" class="method-detail">
977
+ <a name="M000032"></a>
978
+
979
+ <div class="method-heading">
980
+ <a href="QueueManager.src/M000032.html" target="Code" class="method-signature"
981
+ onclick="popupCode('QueueManager.src/M000032.html');return false;">
982
+ <span class="method-name">method_missing</span><span class="method-args">(name, *args)</span>
983
+ </a>
984
+ </div>
985
+
986
+ <div class="method-description">
987
+ </div>
988
+ </div>
989
+
990
+ <div id="method-M000033" class="method-detail">
991
+ <a name="M000033"></a>
992
+
993
+ <div class="method-heading">
994
+ <a href="QueueManager.src/M000033.html" target="Code" class="method-signature"
995
+ onclick="popupCode('QueueManager.src/M000033.html');return false;">
996
+ <span class="method-name">mqsc</span><span class="method-args">(mqsc_text)</span>
997
+ </a>
998
+ </div>
999
+
1000
+ <div class="method-description">
1001
+ <p>
1002
+ Execute any MQSC command against the queue manager
1003
+ </p>
1004
+ <p>
1005
+ Example
1006
+ </p>
1007
+ <pre>
1008
+ require 'wmq/wmq'
1009
+ require 'wmq/wmq_const_admin'
1010
+ WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID', :connection_name=&gt;'localhost(1414)') do |qmgr|
1011
+ qmgr.mqsc('dis ql(*)').each {|item| p item }
1012
+ end
1013
+ </pre>
1014
+ </div>
1015
+ </div>
1016
+
1017
+ <div id="method-M000030" class="method-detail">
1018
+ <a name="M000030"></a>
1019
+
1020
+ <div class="method-heading">
1021
+ <a href="QueueManager.src/M000030.html" target="Code" class="method-signature"
1022
+ onclick="popupCode('QueueManager.src/M000030.html');return false;">
1023
+ <span class="method-name">name</span><span class="method-args">()</span>
1024
+ </a>
1025
+ </div>
1026
+
1027
+ <div class="method-description">
1028
+ <p>
1029
+ Returns the <a href="QueueManager.html">QueueManager</a> name =&gt; String
1030
+ </p>
1031
+ </div>
1032
+ </div>
1033
+
1034
+ <div id="method-M000019" class="method-detail">
1035
+ <a name="M000019"></a>
1036
+
1037
+ <div class="method-heading">
1038
+ <a href="QueueManager.src/M000019.html" target="Code" class="method-signature"
1039
+ onclick="popupCode('QueueManager.src/M000019.html');return false;">
1040
+ <span class="method-name">open_queue(...)<br />
1041
+ access_queue(...)<br />
1042
+ </span>
1043
+ </a>
1044
+ </div>
1045
+
1046
+ <div class="method-description">
1047
+ <p>
1048
+ Open the specified queue, then close it once the supplied code block has
1049
+ completed
1050
+ </p>
1051
+ <p>
1052
+ Parameters:
1053
+ </p>
1054
+ <ul>
1055
+ <li>Since the number of parameters can vary dramatically, all parameters are
1056
+ passed by name in a hash
1057
+
1058
+ </li>
1059
+ <li>See <a href="Queue.html#M000003">Queue.open</a> for the complete list of
1060
+ parameters, except that :queue_manager is <b>not</b> required since it is
1061
+ supplied automatically by this method
1062
+
1063
+ </li>
1064
+ </ul>
1065
+ <p>
1066
+ Example:
1067
+ </p>
1068
+ <pre>
1069
+ require 'wmq/wmq_client'
1070
+
1071
+ WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID', :connection_name=&gt;'localhost(1414)') do |qmgr|
1072
+ qmgr.open_queue(:q_name=&gt;'TEST.QUEUE', :mode=&gt;:output) do |queue|
1073
+ queue.put(:data =&gt; 'Hello World')
1074
+ end
1075
+ end
1076
+ </pre>
1077
+ </div>
1078
+ </div>
1079
+
1080
+ <div id="method-M000024" class="method-detail">
1081
+ <a name="M000024"></a>
1082
+
1083
+ <div class="method-heading">
1084
+ <a href="QueueManager.src/M000024.html" target="Code" class="method-signature"
1085
+ onclick="popupCode('QueueManager.src/M000024.html');return false;">
1086
+ <span class="method-name">put(parameters)<br />
1087
+ </span>
1088
+ </a>
1089
+ </div>
1090
+
1091
+ <div class="method-description">
1092
+ <p>
1093
+ Put a message to the queue without having to first open the queue
1094
+ Recommended for reply queues that change frequently
1095
+ </p>
1096
+ <ul>
1097
+ <li>parameters: a Hash consisting of one or more of the following parameters
1098
+
1099
+ </li>
1100
+ </ul>
1101
+ <p>
1102
+ Summary of parameters and their WebSphere MQ equivalents
1103
+ </p>
1104
+ <pre>
1105
+ queue.get( # WebSphere MQ Equivalents:
1106
+ :q_name =&gt; 'Queue Name', # MQOD.ObjectName
1107
+ :q_name =&gt; { queue_manager=&gt;'QMGR_name', # MQOD.ObjectQMgrName
1108
+ q_name =&gt;'q_name'}
1109
+ :message =&gt; my_message, # n/a : Instance of Message
1110
+ :data =&gt; &quot;Hello World&quot;, # n/a : Data to send
1111
+ :sync =&gt; false, # MQGMO_SYNCPOINT
1112
+ :new_id =&gt; true, # MQPMO_NEW_MSG_ID &amp; MQPMO_NEW_CORREL_ID
1113
+ :new_msg_id =&gt; true, # MQPMO_NEW_MSG_ID
1114
+ :new_correl_id =&gt; true, # MQPMO_NEW_CORREL_ID
1115
+ :fail_if_quiescing =&gt; true, # MQOO_FAIL_IF_QUIESCING
1116
+ :options =&gt; WMQ::MQPMO_FAIL_IF_QUIESCING # MQPMO_*
1117
+ )
1118
+ </pre>
1119
+ <p>
1120
+ Mandatory Parameters
1121
+ </p>
1122
+ <ul>
1123
+ <li>:q_name =&gt; String
1124
+
1125
+ <ul>
1126
+ <li>Name of the existing WebSphere MQ local queue, model queue or remote queue
1127
+ to open
1128
+
1129
+ </li>
1130
+ <li>To open remote queues for which a local remote queue definition is not
1131
+ available pass a Hash as q_name (see q_name =&gt; Hash)
1132
+
1133
+ <pre>
1134
+ OR
1135
+ </pre>
1136
+ </li>
1137
+ </ul>
1138
+ </li>
1139
+ <li>:q_name =&gt; Hash
1140
+
1141
+ <ul>
1142
+ <li>q_name =&gt; String
1143
+
1144
+ <ul>
1145
+ <li>Name of the existing WebSphere MQ local queue, model queue or remote queue
1146
+ to open
1147
+
1148
+ </li>
1149
+ </ul>
1150
+ </li>
1151
+ <li>:q_mgr_name =&gt; String
1152
+
1153
+ <ul>
1154
+ <li>Name of the remote WebSphere MQ queue manager to send the message to.
1155
+
1156
+ </li>
1157
+ <li>This allows a message to be written to a queue on a remote queue manager
1158
+ where a remote queue definition is not defined locally
1159
+
1160
+ </li>
1161
+ <li>Commonly used to reply to messages from remote systems
1162
+
1163
+ </li>
1164
+ <li>If q_mgr_name is the same as the local queue manager name then the message
1165
+ is merely written to the local queue.
1166
+
1167
+ </li>
1168
+ <li>Note: q_mgr_name should only be supplied when putting messages to the
1169
+ queue.
1170
+
1171
+ <pre>
1172
+ It is not possible to get messages from a queue on a queue manager other
1173
+ than the currently connected queue manager
1174
+ </pre>
1175
+ </li>
1176
+ </ul>
1177
+ </li>
1178
+ </ul>
1179
+ </li>
1180
+ <li>Either :message or :data must be supplied
1181
+
1182
+ <ul>
1183
+ <li>If both are supplied, then :data will be written to the queue. The data in
1184
+ :message will be ignored
1185
+
1186
+ </li>
1187
+ </ul>
1188
+ </li>
1189
+ </ul>
1190
+ <p>
1191
+ Optional Parameters
1192
+ </p>
1193
+ <ul>
1194
+ <li>:data =&gt; String
1195
+
1196
+ <ul>
1197
+ <li>Data to be written to the queue. Can be binary or text data
1198
+
1199
+ </li>
1200
+ </ul>
1201
+ </li>
1202
+ <li>:message =&gt; <a href="Message.html">Message</a>
1203
+
1204
+ <ul>
1205
+ <li>An instance of the <a href="Message.html">WMQ::Message</a>
1206
+
1207
+ </li>
1208
+ <li>The <a href="Message.html">Message</a> descriptor, headers and data is
1209
+ retrieved from :message
1210
+
1211
+ <ul>
1212
+ <li>message.data is ignored if :data is supplied
1213
+
1214
+ </li>
1215
+ </ul>
1216
+ </li>
1217
+ </ul>
1218
+ </li>
1219
+ <li>:sync =&gt; true or false
1220
+
1221
+ <ul>
1222
+ <li>Determines whether the get is performed under synchpoint. I.e. Under the
1223
+ current unit of work
1224
+
1225
+ <pre>
1226
+ Default: false
1227
+ </pre>
1228
+ </li>
1229
+ </ul>
1230
+ </li>
1231
+ <li>:new_id =&gt; true or false
1232
+
1233
+ <ul>
1234
+ <li>Generate a new message id and correlation id for this message. :new_msg_id
1235
+ and :new_correl_id will be ignored if this parameter is true
1236
+
1237
+ <pre>
1238
+ Default: false
1239
+ </pre>
1240
+ </li>
1241
+ </ul>
1242
+ </li>
1243
+ <li>:new_msg_id =&gt; true or false
1244
+
1245
+ <ul>
1246
+ <li>Generate a new message id for this message
1247
+
1248
+ </li>
1249
+ <li>Note: A blank message id will result in a new message id anyway. However,
1250
+ for subsequent puts using the same message descriptor, the same message id
1251
+ will be used.
1252
+
1253
+ <pre>
1254
+ Default: false
1255
+ </pre>
1256
+ </li>
1257
+ </ul>
1258
+ </li>
1259
+ <li>:new_correl_id =&gt; true or false
1260
+
1261
+ <ul>
1262
+ <li>Generate a new correlation id for this message
1263
+
1264
+ <pre>
1265
+ Default: false
1266
+ </pre>
1267
+ </li>
1268
+ </ul>
1269
+ </li>
1270
+ <li>:fail_if_quiescing =&gt; true or false
1271
+
1272
+ <ul>
1273
+ <li>Determines whether the <a href="Queue.html#M000007">WMQ::Queue#put</a> call
1274
+ will fail if the queue manager is in the process of being quiesced.
1275
+
1276
+ </li>
1277
+ <li>Note: This interface differs from other WebSphere MQ interfaces, they do
1278
+ not default to true.
1279
+
1280
+ <pre>
1281
+ Default: true
1282
+ Equivalent to: MQGMO_FAIL_IF_QUIESCING
1283
+ </pre>
1284
+ </li>
1285
+ <li>Note: As part of the application design, carefull consideration should be
1286
+ given as to when to allow a transaction or unit of work to complete or fail
1287
+ under this condition. As such it is important to include this option where
1288
+ appropriate so that MQ Administrators can shutdown the queue managers
1289
+ without having to resort to the &#8216;immediate&#8217; shutdown option.
1290
+
1291
+ </li>
1292
+ </ul>
1293
+ </li>
1294
+ <li>:options =&gt; Fixnum (Advanced MQ Use only)
1295
+
1296
+ <ul>
1297
+ <li>Numeric field containing any of the MQ Put message options or&#8217;d
1298
+ together
1299
+
1300
+ <ul>
1301
+ <li>E.g. :options =&gt; WMQ::MQPMO_PASS_IDENTITY_CONTEXT |
1302
+ WMQ::MQPMO_ALTERNATE_USER_AUTHORITY
1303
+
1304
+ </li>
1305
+ </ul>
1306
+ </li>
1307
+ <li>Note: If :options is supplied, it is applied first, then the above
1308
+ parameters are applied afterwards.
1309
+
1310
+ </li>
1311
+ <li>One or more of the following values:
1312
+
1313
+ <pre>
1314
+ WMQ::MQPMO_NO_SYNCPOINT
1315
+ WMQ::MQPMO_LOGICAL_ORDER
1316
+ WMQ::MQPMO_NO_CONTEXT
1317
+ WMQ::MQPMO_DEFAULT_CONTEXT
1318
+ WMQ::MQPMO_PASS_IDENTITY_CONTEXT
1319
+ WMQ::MQPMO_PASS_ALL_CONTEXT
1320
+ WMQ::MQPMO_SET_IDENTITY_CONTEXT
1321
+ WMQ::MQPMO_SET_ALL_CONTEXT
1322
+ WMQ::MQPMO_ALTERNATE_USER_AUTHORITY
1323
+ WMQ::MQPMO_RESOLVE_LOCAL_Q
1324
+ WMQ::MQPMO_NONE
1325
+ </pre>
1326
+ </li>
1327
+ <li>Please see the WebSphere MQ documentation for more details on the above
1328
+ options
1329
+
1330
+ <pre>
1331
+ Default: WMQ::MQPMO_NONE
1332
+ </pre>
1333
+ </li>
1334
+ </ul>
1335
+ </li>
1336
+ </ul>
1337
+ <p>
1338
+ Returns:
1339
+ </p>
1340
+ <ul>
1341
+ <li>true : On Success
1342
+
1343
+ </li>
1344
+ <li>false: On Failure
1345
+
1346
+ <p>
1347
+ <a href="QueueManager.html#M000025">comp_code</a> and <a
1348
+ href="QueueManager.html#M000026">reason_code</a> are also updated. reason
1349
+ will return a text description of the <a
1350
+ href="QueueManager.html#M000026">reason_code</a>
1351
+ </p>
1352
+ </li>
1353
+ </ul>
1354
+ <p>
1355
+ Throws:
1356
+ </p>
1357
+ <ul>
1358
+ <li><a href="WMQException.html">WMQ::WMQException</a> if <a
1359
+ href="QueueManager.html#M000025">comp_code</a> == MQCC_FAILED
1360
+
1361
+ </li>
1362
+ <li>Except if :<a href="QueueManager.html#M000028">exception_on_error</a> =&gt;
1363
+ false was supplied as a parameter to <a
1364
+ href="QueueManager.html#M000016">QueueManager.new</a>
1365
+
1366
+ </li>
1367
+ </ul>
1368
+ </div>
1369
+ </div>
1370
+
1371
+ <div id="method-M000035" class="method-detail">
1372
+ <a name="M000035"></a>
1373
+
1374
+ <div class="method-heading">
1375
+ <a href="QueueManager.src/M000035.html" target="Code" class="method-signature"
1376
+ onclick="popupCode('QueueManager.src/M000035.html');return false;">
1377
+ <span class="method-name">put_to_dead_letter_q</span><span class="method-args">(parms)</span>
1378
+ </a>
1379
+ </div>
1380
+
1381
+ <div class="method-description">
1382
+ <p>
1383
+ Put a message to the Dead Letter <a href="Queue.html">Queue</a>
1384
+ </p>
1385
+ <pre>
1386
+ If an error occurs when processing a datagram message
1387
+ it is necessary to move the message to the dead letter queue.
1388
+ I.e. An error message cannot be sent back to the sender because
1389
+ the original message was not a request message.
1390
+ I.e. msg_type != WMQ::MQMT_REQUEST
1391
+
1392
+ All existing message data, message descriptor and message headers
1393
+ are retained.
1394
+ </pre>
1395
+ </div>
1396
+ </div>
1397
+
1398
+ <div id="method-M000034" class="method-detail">
1399
+ <a name="M000034"></a>
1400
+
1401
+ <div class="method-heading">
1402
+ <a href="QueueManager.src/M000034.html" target="Code" class="method-signature"
1403
+ onclick="popupCode('QueueManager.src/M000034.html');return false;">
1404
+ <span class="method-name">put_to_reply_q</span><span class="method-args">(parms)</span>
1405
+ </a>
1406
+ </div>
1407
+
1408
+ <div class="method-description">
1409
+ <p>
1410
+ Put a reply message back to the sender
1411
+ </p>
1412
+ <pre>
1413
+ The :message is sent to the queue and queue manager specified in the
1414
+ :reply_to_q and :reply_to_q_mgr propoerties of the :request_message.
1415
+
1416
+ The following rules are followed before sending the reply:
1417
+ - Only send replies to Request messages. No reply for Datagrams
1418
+ - Set the message type to Reply when replying to a request message
1419
+ - Reply with:
1420
+ - Remaining Expiry (Ideally deduct any processing time since get)
1421
+ - Same priority as received message
1422
+ - Same persistence as received message
1423
+ - Adhere to the Report options supplied for message and correlation id's
1424
+ in reply message
1425
+ - All headers must be returned on reply messages
1426
+ - This allows the calling application to store state information
1427
+ in these headers
1428
+ - Unless of course if the relevant header is input only and used
1429
+ for completing the request
1430
+ - In this case any remaining headers should be returned
1431
+ to the caller
1432
+ </pre>
1433
+ <p>
1434
+ Parameters:
1435
+ </p>
1436
+ <pre>
1437
+ * :request_message The message originally received
1438
+ * All the other parameters are the same as QueueManager#put
1439
+ </pre>
1440
+ </div>
1441
+ </div>
1442
+
1443
+ <div id="method-M000027" class="method-detail">
1444
+ <a name="M000027"></a>
1445
+
1446
+ <div class="method-heading">
1447
+ <a href="QueueManager.src/M000027.html" target="Code" class="method-signature"
1448
+ onclick="popupCode('QueueManager.src/M000027.html');return false;">
1449
+ <span class="method-name">reason</span><span class="method-args">()</span>
1450
+ </a>
1451
+ </div>
1452
+
1453
+ <div class="method-description">
1454
+ <p>
1455
+ Returns a textual representation of the <a
1456
+ href="QueueManager.html#M000026">reason_code</a> for the last MQ operation
1457
+ </p>
1458
+ <p>
1459
+ Returns =&gt; String
1460
+ </p>
1461
+ <ul>
1462
+ <li>For a complete list of reasons, please see <a href="../WMQ.html">WMQ</a>
1463
+ Constants or the WebSphere MQ documentation for Reason Codes
1464
+
1465
+ </li>
1466
+ </ul>
1467
+ <p>
1468
+ Note
1469
+ </p>
1470
+ <ul>
1471
+ <li>The list of Reason Codes varies depending on the version of WebSphere MQ
1472
+ and the operating system on which Ruby <a href="../WMQ.html">WMQ</a> was
1473
+ compiled
1474
+
1475
+ </li>
1476
+ </ul>
1477
+ </div>
1478
+ </div>
1479
+
1480
+ <div id="method-M000026" class="method-detail">
1481
+ <a name="M000026"></a>
1482
+
1483
+ <div class="method-heading">
1484
+ <a href="QueueManager.src/M000026.html" target="Code" class="method-signature"
1485
+ onclick="popupCode('QueueManager.src/M000026.html');return false;">
1486
+ <span class="method-name">reason_code</span><span class="method-args">()</span>
1487
+ </a>
1488
+ </div>
1489
+
1490
+ <div class="method-description">
1491
+ <p>
1492
+ Return the reason code for the last MQ operation
1493
+ </p>
1494
+ <p>
1495
+ Returns =&gt; FixNum
1496
+ </p>
1497
+ <ul>
1498
+ <li>For a complete list of reason codes, please see <a
1499
+ href="../WMQ.html">WMQ</a> Constants or the WebSphere MQ documentation for
1500
+ Reason Codes
1501
+
1502
+ </li>
1503
+ </ul>
1504
+ <p>
1505
+ Note
1506
+ </p>
1507
+ <ul>
1508
+ <li>The list of Reason Codes varies depending on the version of WebSphere MQ
1509
+ and the operating system on which Ruby <a href="../WMQ.html">WMQ</a> was
1510
+ compiled
1511
+
1512
+ </li>
1513
+ </ul>
1514
+ </div>
1515
+ </div>
1516
+
1517
+
1518
+ </div>
1519
+
1520
+
1521
+ </div>
1522
+
1523
+
1524
+ <div id="validator-badges">
1525
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
1526
+ </div>
1527
+
1528
+ </body>
1529
+ </html>