message-queue

Getting number of messages in a RabbitMQ queue

被刻印的时光 ゝ 提交于 2019-11-26 21:30:22
问题 We're using amqplib to publish/consume messages. I want to be able to read the number of messages on a queue (ideally both acknowledged and unacknowledged). This will allow me to show a nice status diagram to the admin users and detect if a certain component is not keeping up with the load. I can't find any information in the amqplib docs about reading queue status. Can someone point me in the right direction? 回答1: Using pika: import pika pika_conn_params = pika.ConnectionParameters( host=

What is the relationship between Looper, Handler and MessageQueue in Android?

筅森魡賤 提交于 2019-11-26 21:14:41
I have checked the official Android documentation/guide for Looper , Handler and MessageQueue . But I couldn't get it. I am new to android, and got very confused with these concepts. A Looper is a message handling loop: it reads and processes items from a MessageQueue . The Looper class is usually used in conjunction with a HandlerThread (a subclass of Thread ). A Handler is a utility class that facilitates interacting with a Looper —mainly by posting messages and Runnable objects to the thread's MessageQueue . When a Handler is created, it is bound to a specific Looper (and associated thread

Advice on Python/Django and message queues

泪湿孤枕 提交于 2019-11-26 18:49:34
问题 I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons. Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django project? The rest of my stack is Apache, mod_python, MySQL. 回答1: So far I have found no "nice" solution for this. I have some more strict soft realtime requirements (taking a

Long running REST API with queues

时间秒杀一切 提交于 2019-11-26 18:46:31
问题 We are implementing a REST API, which will kick off multiple long running backend tasks. I have been reading the RESTful Web Services Cookbook and the recommendation is to return HTTP 202 / Accepted with a Content-Location header pointing to the task being processed. (e.g. http://www.example.org/orders/tasks/1234), and have the client poll this URI for an update on the long running task. The idea is to have the REST API immediately post a message to a queue, with a background worker role

Is there any reason to use RabbitMQ over Kafka?

冷暖自知 提交于 2019-11-26 18:42:36
问题 I've been asked to evaluate RabbitMQ instead of Kafka but found it hard to find a reason that it's doing something better than Kafka. Does anyone know if it is really better in throughput, durability, latency, or ease-of-use? 回答1: RabbitMQ is a solid, general purpose message broker that supports several protocols such as AMQP, MQTT, STOMP, etc. It can handle high throughput. A common use case for it is to handle background jobs or to act as a message broker between microservices. Kafka is a

Connecting to IBM MQ using CCDT file in JMS

岁酱吖の 提交于 2019-11-26 18:35:16
问题 I am trying to connect to IBM MQ using JMS and client channel definition table (CCDT). I was able to connect successfully to the QueueManager when i specify the MQ properties individually. But when i try to use CCDT file i get the below exception. As client channel definition table (CCDT) is used to determine the channel definitions used by client applications to connect to the queue manager i didnt set QueueManager Name. ERROR> com.ssc.ach.mq.JMSMQReceiver[main]: errorMQJMS2005: failed to

What is the best way to format messages for queueing?

拥有回忆 提交于 2019-11-26 16:39:31
问题 I've been reading up on message queueing lately, and I'd like to implement a simple, extendable, system for my app. While there's a lot of good information on the subject of setting up a MQ system out there, I can't find a lot about the actual implementation. I'm looking for patterns and best practices on how to properly format messages for a queue, and ways to execute the jobs in PHP. Should I use JSON, serialized objects, text, URLs or XML? What information should I send? Is a worker with a

Using many consumers in SQS Queue

眉间皱痕 提交于 2019-11-26 16:33:35
I know that it is possible to consume a SQS queue using multiple threads. I would like to guarantee that each message will be consumed once. I know that it is possible to change the visibility timeout of a message, e.g., equal to my processing time. If my process spend more time than the visibility timeout (e.g. a slow connection) other thread can consume the same message. What is the best approach to guarantee that a message will be processed once? Krease What is the best approach to guarantee that a message will be processed once? You're asking for a guarantee - you won't get one . You can

Cannot find the declaration of element 'beans'

て烟熏妆下的殇ゞ 提交于 2019-11-26 13:03:24
问题 I have the spring jars of spring-3.2.0.RC1.jar and trying to implement Apache ActiveMQ helloWorld program from tutorial given here. The xml configuration file is: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <beans xmlns:jms=\"http://www.springframework.org/schema/jms\" xmlns:p=\"http://www.springframework.org/schema/p\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.springframework.org/schema/beans\" xsi:schemalocation=\"http://www.springframework.org/schema/beans

Is there a performance difference between pooling connections or channels in rabbitmq?

梦想与她 提交于 2019-11-26 11:54:07
问题 I\'m a newbie with Rabbitmq(and programming) so sorry in advance if this is obvious. I am creating a pool to share between threads that are working on a queue but I\'m not sure if I should use connections or channels in the pool. I know I need channels to do the actual work but is there a performance benefit of having one channel per connection(in terms of more throughput from the queue)? or am I better off just using a single connection per application and pool many channels? note: because I