Closed CrazyMan2 closed 5 years ago
Hi @CrazyMan2 , what did u do to solve this ?
For those who have problems with this in the future, the way to solve the problem is by editing the file: RabbitMqConnection.java
on line 144
change the value of this.channel.basicQos
that is set to 1
to 0
Before
this.channel.basicQos(1);
After
this.channel.basicQos(0);
The problem occurs because when adding the value 1 we tell it that the limit of messages in the queue is 1 and if we add 0 we tell it that it is infinite.
“ react”:“ 16.8.3”, “ react-native”:“ 0.59.8”, “ react-native-rabbitmq”:“ ^ 0.6.3”
export function rabbitMqPublish(message) { exchange.publish(message,queueId,{aa:11}); } export function initRabbitMq() { connection.connect(); connection.on('error',(event)=>{ connected=false; console.log("connected fail"); }); connection.on('connected',(event)=>{ connected=true; console.log("connected success"); queue=new Queue(connection,{ name:queueId, durable:false, autoDelete:false, exclusive:false, consumer_arguments:{'x-priority':1} }); exchange = new Exchange(connection, { name: exchange_name, type: 'fanout', durable: false, autoDelete: false, exclusive: false, internal: false, confirm: true }); queue.bind(exchange, queueId);
} rabbitMqPublish publish a message ,queue.on Receives the message only one,After unable to receive messages