Skip to content

On ios getting connected and then error #27

@willson-spark-rex

Description

@willson-spark-rex

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"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions