kegaretail / react-native-rabbitmq

29 stars 56 forks source link

On ios getting connected and then error #27

Open willson-spark-rex opened 4 years ago

willson-spark-rex commented 4 years ago

let connection = new Connection(config) connection.connect() let queue; let exchange; connection.on('connected', (event) => { console.log("connected") queue = new Queue(connection, { name: ${userId}, passive: false, durable: true, exclusive: false, consumer_arguments: {'x-priority': 1} },{"x-queue-mode" : "lazy"});

    exchange = new Exchange(connection, {
      name: 'spmq_1001_durable',
      type: 'topic',
      durable: true,
      autoDelete: false,
      internal: false
  });     

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

   queue.basicAck(data.delivery_tag)

    });

  });

  connection.on('error', event => {
    console.tron.log("you are not connected");
  });
}

This code is working on android but on ios its call giving connected first and then {"code": "5", "description": "Cannot use channel after it has been closed.", "name": "error", "type": "channel"}

Ro392 commented 4 years ago

I have the same problem. I reported it over a month ago but I didn't receive any solution. I see that the problem occurs when the queue has some arguments set for example: x-message-ttl, x-queue-mode, x-expires.... When the queue in rabbitmq does not exist then it is trying to create queue with this arguments. Just like in the picture. But when you open the queue Features is gone. Another problem is the value of the argument because I set 'x-message-ttl': 86400000 but in cloudamqp I can see x-message-ttl: 11776

Zrzut ekranu 2020-02-10 o 15 15 17 Zrzut ekranu 2020-02-10 o 15 16 37
mrozkosz commented 4 years ago

Do you have any solution? I have the same problem and my application does not work because There is some Bug. Is there author od this? Can you solve this issue?

timhonders commented 4 years ago

I am very busy at the moment, when i have time i wil check this problem.

@mrozkosz What is youre problem exactly

Wilson-Lim commented 4 years ago

I am having this error , can any1 help ?

Screenshot 2020-03-07 at 1 13 05 AM
mrozkosz commented 4 years ago

My clear project | ISSUE ONLY ON IOS

I'm trying connect to exist Queue with arguments. Without this arguments It works

Zrzut ekranu 2020-03-14 o 16 12 30

CODE

Zrzut ekranu 2020-03-14 o 16 20 24 Zrzut ekranu 2020-03-14 o 16 25 29