1.0.9 • Published 4 years ago

react-native-fixed-rabbitmq v1.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Installation

yarn add react-native-fixed-rabbitmq

Usage

import { Connection, Exchange, Queue } from 'react-native-fixed-rabbitmq';

const config = {
    host:'',
    port:5672,
    username:'user',
    password:'password',
    virtualhost:'vhost',
    ttl: 10000 // Message time to live,
    ssl: true // Enable ssl connection, make sure the port is 5671 or an other ssl port
}

const rabbitServer = new Connection(config)

rabbitServer.on('error', (event) => {
    console.log('eventoErro', event)
})

rabbitServer.on('connected', (event) => {

    let queue = new Queue(rabbitServer, {
        name: '',
        passive: false,
        durable: false,
        exclusive: true,
        consumer_arguments: { 'x-priority': 1 }
    }, {

        });

    let exchange = new Exchange(this.rabbitServer, {
        name: 'app',
        type: 'fanout',
        durable: false,
        autoDelete: false,
        internal: false
    });

    queue.bind(exchange, '');
    queue.on('message', (data) => {
    	
    });
};

rabbitServer.connect();
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago