Index: trunk/extensions/DonationInterface/donationinterface.php |
— | — | @@ -357,6 +357,7 @@ |
358 | 358 | //$wgStompQueueName = ""; //only set this with an actual value. Default is unset. |
359 | 359 | //$wgPendingStompQueueName = ""; //only set this with an actual value. Default is unset. |
360 | 360 | //$wgLimboStompQueueName = ""; //only set this with an actual value. Default is unset. |
| 361 | + //$wgCCLimboStompQueueName = ""; //only set this with an actual value. Default is unset. |
361 | 362 | } |
362 | 363 | |
363 | 364 | //Extras globals - required for ANY optional class that is considered an "extra". |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | if ( count( $bucket ) && ( count( $bucket ) >= $count || $ackNow ) ){ |
119 | 119 | //ack now. |
120 | 120 | $selector = 'JMSCorrelationID IN (' . implode( ", ", $bucket ) . ')'; |
121 | | - $ackMe = stompFetchMessages( 'limbo', $selector, $count * 100 ); //This is outrageously high, but I just want to be reasonably sure we get all the matches. |
| 121 | + $ackMe = stompFetchMessages( 'cc-limbo', $selector, $count * 100 ); //This is outrageously high, but I just want to be reasonably sure we get all the matches. |
122 | 122 | $retrieved_count = count( $ackMe ); |
123 | 123 | if ( $retrieved_count ){ |
124 | 124 | stompAckMessages( $ackMe ); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | |
132 | 132 | function handleStompAntiMessages(){ |
133 | 133 | $selector = "antimessage = 'true'"; |
134 | | - $antimessages = stompFetchMessages( 'limbo', $selector, 1000 ); |
| 134 | + $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 ); |
135 | 135 | $count = 0; |
136 | 136 | while ( count( $antimessages ) ){ //if there's an antimessage, we can ack 'em all right now. |
137 | 137 | $count += count( $antimessages ); |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | echo 'The STOMP message ' . $message->headers['message-id'] . ' has no correlation ID!'; |
144 | 144 | } |
145 | 145 | } |
146 | | - $antimessages = stompFetchMessages( 'limbo', $selector, 1000 ); |
| 146 | + $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 ); |
147 | 147 | } |
148 | 148 | $this->addStompCorrelationIDToAckBucket( false, true ); //this just acks everything that's waiting for it. |
149 | 149 | $this->adapter->log("Found $count antimessages."); |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | function getStompOrphans(){ |
157 | 157 | $time_buffer = 60*20; //20 minutes? Sure. Why not? |
158 | 158 | $selector = "payment_method = 'cc'"; |
159 | | - $messages = stompFetchMessages( 'limbo', $selector, 300 ); |
| 159 | + $messages = stompFetchMessages( 'cc-limbo', $selector, 300 ); |
160 | 160 | $orphans = array(); |
161 | 161 | foreach ( $messages as $message ){ |
162 | 162 | if ( !array_key_exists('antimessage', $message->headers ) |
Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -1529,9 +1529,17 @@ |
1530 | 1530 | if ( !$this->getGlobal( 'EnableStomp' ) ){ |
1531 | 1531 | return; |
1532 | 1532 | } |
1533 | | - global $wgLimboStompQueueName; |
1534 | | - if ( !isset( $wgLimboStompQueueName ) || $wgLimboStompQueueName === false ){ |
1535 | | - return; |
| 1533 | + |
| 1534 | + if ($this->getData_Raw( 'payment_method' ) === 'cc'){ |
| 1535 | + global $wgCCLimboStompQueueName; |
| 1536 | + if ( !isset( $wgCCLimboStompQueueName ) || $wgCCLimboStompQueueName === false ){ |
| 1537 | + return; |
| 1538 | + } |
| 1539 | + } else { |
| 1540 | + global $wgLimboStompQueueName; |
| 1541 | + if ( !isset( $wgLimboStompQueueName ) || $wgLimboStompQueueName === false ){ |
| 1542 | + return; |
| 1543 | + } |
1536 | 1544 | } |
1537 | 1545 | |
1538 | 1546 | $this->debugarray[] = "Attempting Limbo Stomp Transaction!"; |
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php |
— | — | @@ -128,10 +128,14 @@ |
129 | 129 | * nothing exploded big enough to kill the whole thing. |
130 | 130 | */ |
131 | 131 | function sendLimboSTOMP( $transaction ) { |
132 | | - global $wgStompServer, $wgLimboStompQueueName; |
| 132 | + global $wgStompServer, $wgLimboStompQueueName, $wgCCLimboStompQueueName; |
| 133 | + |
| 134 | + if ( $transaction['payment_method'] === 'cc' ) { |
| 135 | + $queueName = isset( $wgCCLimboStompQueueName ) ? $wgCCLimboStompQueueName : 'cc-limbo'; |
| 136 | + } else { |
| 137 | + $queueName = isset( $wgLimboStompQueueName ) ? $wgLimboStompQueueName : 'limbo'; |
| 138 | + } |
133 | 139 | |
134 | | - $queueName = isset( $wgLimboStompQueueName ) ? $wgLimboStompQueueName : 'limbo'; |
135 | | - |
136 | 140 | // include a library |
137 | 141 | require_once( "Stomp.php" ); |
138 | 142 | |
— | — | @@ -244,7 +248,7 @@ |
245 | 249 | * @return array an array of stomp messages, with a count of up to $limit. |
246 | 250 | */ |
247 | 251 | function stompFetchMessages( $queue, $selector = null, $limit = 50 ){ |
248 | | - global $wgStompQueueName, $wgPendingStompQueueName, $wgLimboStompQueueName; |
| 252 | + global $wgStompQueueName, $wgPendingStompQueueName, $wgLimboStompQueueName, $wgCCLimboStompQueueName; |
249 | 253 | |
250 | 254 | switch($queue){ |
251 | 255 | case 'pending': |
— | — | @@ -253,6 +257,9 @@ |
254 | 258 | case 'limbo': |
255 | 259 | $queue = $wgLimboStompQueueName; |
256 | 260 | break; |
| 261 | + case 'cc-limbo': |
| 262 | + $queue = $wgCCLimboStompQueueName; |
| 263 | + break; |
257 | 264 | case 'verified': |
258 | 265 | default: |
259 | 266 | $queue = $wgStompQueueName; |