amqp

using rabbitmq in android for chat

纵饮孤独 提交于 2019-12-04 12:21:01
问题 We have implemented rabbitmq chat in android. but java client of rabbitmq is power hungry.is rabbitmq good for android chat?. we have used direct exchange individual queue for persons and individual routing keys. what is the best design pattern for one to one chat in rabbitmq. and also ways to reduce battery usage 回答1: I don't think that use RabbitMQ directly for developing a chat is the better solution. There are other solution more light please read this post about MQTT. Another standard

rabbitmq AMQP::consume()

让人想犯罪 __ 提交于 2019-12-04 11:15:43
AMQP function consume() is a blocking function with a callback, Is it possible to set a timeout for consume() function, so after specific amount of time it doesn't block anymore and the code execution completes ? Yes, here's how: $amqp = new AMQPConnection($your_connection_params); $amqp->setTimeout($seconds); Then when you call consume() on a queue, if no messages arrive within the timeout period, an AMQPException will be thrown from consume() with the message, "Resource temporarily unavailable". If you ever break out of consume() or hit a timeout, be sure to call cancel() on the queue object

Swapping out MSMQ for RabbitMQ in NServiceBus

主宰稳场 提交于 2019-12-04 10:52:18
问题 Udi mentions here that "people have swapped out the MSMQ layer of NServiceBus and plugged in RabbitMQ in its place". I'm looking to do the same thing with the end goal of being able to run an app built with NServiceBus on Mono/Linux with AMQP. Before diving in though I'd like to get some feedback from people who might have done this already about pitfalls to avoid, red herrings etc. Alternatively if the approach is a massive undertaking, it might be best to just use RabbitMQ directly, but if

Locks and batch fetch messages with RabbitMq

回眸只為那壹抹淺笑 提交于 2019-12-04 10:47:13
问题 I'm trying to use RabbitMq in a more unconventional way (though at this point i can pick any other message queue implementation if needed). Instead of leaving Rabbit push messages to my consumers, the consumer connects to a queue and fetches a batch of N messages (during which it consumes some and possible rejects some), after which it jumps to another queue and so on. This is done for redundancy. If some consumers crash all messages are guaranteed to be consumed by some other consumer. The

AMQP Delay Delivery and Prevent Duplicate Messages

早过忘川 提交于 2019-12-04 09:29:28
I have a system that will generate messages sporadically, and I would like to only submit either zero or one message every 5 minutes. If no message is generated, nothing would be processed by the queue consumer. If a hundred identical messages are generated within 5 minutes I only want one of those to be consumed from the queue. I am using AMQP(RabbitMQ), is there a way to accomplish this within rabbitmq or the AMQP protocol? Can I inspect a queue's contents to ensure that I don't insert a duplicate? It seems that queue inspection is a bad idea and not typically what should be done for a

RabbitMQ: messages remain “Unacknowledged”

纵饮孤独 提交于 2019-12-04 09:02:45
问题 My Java application sends messages to RabbitMQ exchange, then exchange redirects messages to binded queue. I use Springframework AMQP java plugin with RabbitMQ. The problem: message comes to queue, but it stays in "Unacknowledged" state, it never becomes "Ready". What could be the reason? 回答1: An Unacknowledged message implies that it has been read by your consumer, but the consumer has never sent back an ACK to the RabbitMQ broker to say that it has finished processing it. I'm not overly

Where are the AMQP 1.0 implementations? Would it make sense to wait?

江枫思渺然 提交于 2019-12-04 08:56:18
问题 I'm doing research to figure out what messaging solution to settle on for our future products and I can't really figure this one out. There is a bunch of AMQP 0.9.1 implementations (RabbitMQ, Apache Qpid, OpenAMQ, to name a few), but no AMQP 1.0 implementation, although 1.0 has been finalized October 2011. Well, except for SwiftMQ [1]. Reading up on 1.0, it seems to be a major departure from the pre-1.0 spec, so it seems understandable that there's little enthusiasm for a major rewrite of

消息队列总结

牧云@^-^@ 提交于 2019-12-04 08:29:52
消息队列 本文内容思维导图: 消息队列总结 一 什么是消息队列 我们可以把消息队列比作是一个存放消息的容器,当我们需要使用消息的时候可以取出消息供自己使用。消息队列是分布式系统中重要的组件,使用消息队列主要是为了通过异步处理提高系统性能和削峰、降低系统耦合性。目前使用较多的消息队列有ActiveMQ,RabbitMQ,Kafka,RocketMQ,我们后面会一一对比这些消息队列。 另外,我们知道队列 Queue 是一种先进先出的数据结构,所以消费消息时也是按照顺序来消费的。比如生产者发送消息1,2,3...对于消费者就会按照1,2,3...的顺序来消费。但是偶尔也会出现消息被消费的顺序不对的情况,比如某个消息消费失败又或者一个 queue 多个consumer 也会导致消息被消费的顺序不对,我们一定要保证消息被消费的顺序正确。 除了上面说的消息消费顺序的问题,使用消息队列,我们还要考虑如何保证消息不被重复消费?如何保证消息的可靠性传输(如何处理消息丢失的问题)?......等等问题。所以说使用消息队列也不是十全十美的,使用它也会让系统可用性降低、复杂度提高,另外需要我们保障一致性等问题。 二 为什么要用消息队列 使用消息队列主要有两点好处: 1.通过异步处理提高系统性能(削峰、减少响应所需时间); 2.降低系统耦合性。 (1) 通过异步处理提高系统性能(削峰、减少响应所需时间)

Check RabbitMQ queue size from client

社会主义新天地 提交于 2019-12-04 07:45:16
问题 Does anyone know if there's a way to check the number of messages in a RabbitMQ queue from a client application? I'm using the .NET client library. 回答1: You actually can retrieve this via the client. When perform a queue_declare operation RabbitMQ returns a three tuple containing (<queue name>, <message count>, <consumer count>) . The passive argument to queue_declare allows you to check whether a queue exists without modifying the server state. So you can use queue_declare with the passive

How to fetch messages from an Azure Service Bus Queue in “PeekLock” mode using AMQP?

一世执手 提交于 2019-12-04 07:18:20
We're trying to consume Azure Service Bus in a Node application. Our requirement is to fetch multiple messages from a queue . Since Azure SDK for Node doesn't support batch retrieval, we decided to use AMQP. While we're able to fetch messages using Peek Messages as described here ( https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response#message-operations ). What we are noticing is that as soon as messages are fetched, they are getting removed from the queue. I am wondering if anyone has an insight into how we can fetch messages in "PeekLock" mode using