You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

This transport handler allow to send and receive object via the AQMP protocol, implemented with RabbitMQ (see http://www.rabbitmq.com/). Further parameter information can be found here: http://www.rabbitmq.com/api-guide.html

Options

  • queue_name: The queue to send to or receive from

  • exchange_name: The exchange to publish the message to
  • consumer_tag: The consumer tag

  • host: The host where the server runs

  • port: The port of the server (if not default)

  • username: Username (if required)

  • password: Password (if required)

  • virtualhost: The virtual host (if required)

  • publish_style: Specifies how messages will be sent (default: workqueue)

Additional Options for workqueue

  • durable (true / false)
  • exclusive (true / false)
  • auto_delete (true / false)

In addition, arbitrary options can bedefined. They need to start with the prefix "rabbit." which will be removed in the actual argument. Example: ['rabbit.x-message-ttl',1000]  will be the argument 'x-message-ttl' with the long value '1000'

Work queue example

/// Send elements to bus (work queue)
SENDER = SENDER({
              transport='RabbitMQ',
              wrapper='GenericPush',
              protocol='SimpleByteBuffer',
              datahandler='Tuple',
              SINK="SENDER",
              options=[
                ['QUEUE_NAME','nexmark'],
                ['CONSUMER_TAG','person'],
                ['HOST','localhost'],
                ['ByteOrder', 'LittleEndian']
              ]                        
            },
            nexmark:person
          )

/// Receive elements from bus (work queue)
input = ACCESS({
            transport='RabbitMQ',
            source= 'Receiver',
            wrapper='GenericPush',
            protocol='SimpleByteBuffer',
            datahandler='Tuple',
            options=[
              ['QUEUE_NAME','nexmark'],
              ['CONSUMER_TAG','person'],
              ['HOST','localhost'],
              ['ByteOrder', 'LittleEndian']
            ],
            schema=[
              ['TIMESTAMP', 'STARTTIMESTAMP'],
              ['id', 'INTEGER'],
              ['name', 'STRING'],
              ['email', 'STRING'],
              ['creditcard', 'STRING'],
              ['city', 'STRING'],
              ['state', 'STRING']
            ]                                            
          }                
        )


Publish-subscribe example

/// Send elements to bus (publish-subscribe)
SENDER = SENDER({
              transport='RabbitMQ',
              wrapper='GenericPush',
              protocol='SimpleByteBuffer',
              datahandler='Tuple',
              SINK="SENDER",
              options=[
                ['EXCHANGE_NAME','nexmark'],
                ['PUBLISH_STYLE','publishsubscribe'],
                ['CONSUMER_TAG','person'],
                ['HOST','localhost'],
                ['ByteOrder', 'LittleEndian']
              ]                        
            },
            nexmark:person
          )

/// Receive elements from bus (publish-subscribe)
input = ACCESS({
            transport='RabbitMQ',
            source= 'Receiver',
            wrapper='GenericPush',
            protocol='SimpleByteBuffer',
            datahandler='Tuple',
            options=[
              ['EXCHANGE_NAME','nexmark'],
              ['PUBLISH_STYLE','publishsubscribe'],
              ['CONSUMER_TAG','person'],
              ['HOST','localhost'],
              ['ByteOrder', 'LittleEndian']
            ],
            schema=[
              ['TIMESTAMP', 'STARTTIMESTAMP'],
              ['id', 'INTEGER'],
              ['name', 'STRING'],
              ['email', 'STRING'],
              ['creditcard', 'STRING'],
              ['city', 'STRING'],
              ['state', 'STRING']
            ]                                            
          }                
        )


  • No labels