Changeset cb991cc72f550faba728557f2ec72a3d63542e92

Show
Ignore:
Timestamp:
11/10/09 16:44:43 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1257871483 +0000
git-parent:

[d855ea0243033b7550d661d296ceaf7b5bf94e75]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1257871483 +0000
Message:

openwire never worked, clean it out

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_iep.c

    r9202df1 rcb991cc  
    5151#endif 
    5252#include <assert.h> 
    53 #ifdef OPENWIRE 
    54 #include "amqcs.h" 
    55 #else 
    5653#include "stomp/stomp.h" 
    57 #endif 
    5854 
    5955eventer_jobq_t iep_jobq; 
     
    6258 
    6359struct iep_thread_driver { 
    64 #ifdef OPENWIRE 
    65   amqcs_connect_options connect_options; 
    66   amqcs_connection *connection; 
    67 #else 
    6860  stomp_connection *connection; 
    69 #endif 
    7061  apr_pool_t *pool; 
    7162  char* exchange; 
     
    342333                                hostname, sizeof(hostname))) 
    343334      strlcpy(hostname, "127.0.0.1", sizeof(hostname)); 
    344 #ifdef OPENWIRE 
    345     memset(&driver->connect_options, 0, sizeof(driver->connect_options)); 
    346     strlcpy(driver->connect_options.hostname, hostname, 
    347             sizeof(driver->connect_options.hostname)); 
    348     driver->connect_options.port = port; 
    349     if(amqcs_connect(&driver->connection, &driver->connect_options, 
    350                      driver->pool) != APR_SUCCESS) { 
    351       noitL(noit_error, "MQ connection failed\n"); 
    352       return NULL; 
    353     } 
    354 #else 
    355335    if(stomp_connect(&driver->connection, hostname, port, 
    356336                     driver->pool)!= APR_SUCCESS) { 
     
    399379      } 
    400380    }   
    401 #endif 
    402381    stratcon_iep_submit_statements(); 
    403382    stratcon_datastore_iep_check_preload(); 
     
    463442    int line_len = strlen(job->line); 
    464443    int remote_len = strlen(job->remote); 
    465 #ifdef OPENWIRE 
    466     ow_ActiveMQQueue *dest; 
    467     ow_ActiveMQTextMessage *message; 
    468  
    469     apr_pool_create(&job->pool, driver->pool); 
    470     message = ow_ActiveMQTextMessage_create(job->pool); 
    471     message->content = 
    472       ow_byte_array_create_with_data(job->pool,strlen(job->doc_str), 
    473                                      job->doc_str); 
    474     dest = ow_ActiveMQQueue_create(job->pool); 
    475     dest->physicalName = ow_string_create_from_cstring(job->pool,"TEST.QUEUE");          
    476     rc = amqcs_send(driver->connection, 
    477                     (ow_ActiveMQDestination*)dest, 
    478                     (ow_ActiveMQMessage*)message, 
    479                     1,4,0,job->pool); 
    480     if(rc != APR_SUCCESS) { 
    481       noitL(noit_error, "MQ send failed, disconnecting\n"); 
    482       if(driver->connection) amqcs_disconnect(&driver->connection); 
    483       driver->connection = NULL; 
    484     } 
    485 #else 
    486444    stomp_frame out; 
    487445 
     
    511469      driver->connection = NULL; 
    512470    } 
    513 #endif 
    514471  } 
    515472  else { 
     
    572529static void connection_destroy(void *vd) { 
    573530  struct iep_thread_driver *driver = vd; 
    574 #ifdef OPENWIRE 
    575   if(driver->connection) amqcs_disconnect(&driver->connection); 
    576 #else 
    577531  if(driver->connection) stomp_disconnect(&driver->connection); 
    578532  if(driver->exchange) free(driver->exchange); 
    579 #endif 
    580533  if(driver->pool) apr_pool_destroy(driver->pool); 
    581534  free(driver);