message-queue

Check if a IPC message queue already exists without creating it

南笙酒味 提交于 2020-01-25 21:13:12
问题 How can I just check if a message queue exists or not without making it? When using msgget with O_CREAT | O_EXCL flag, if it exists, the call will fail with return value -1, but if it doesn't, it will then create a new message queue. Is there any way to just check? 回答1: ipcs(1) provides information on the IPC facilities and ipcrm(1) can be used to remove the IPC objects from the system. List shared memory segments: ipcs -m List message queues: ipcs -q Remove shared memory segment created with

with MessageEnumerator RemoveCurrent how do I know if I am at end of queue?

余生长醉 提交于 2020-01-24 04:25:28
问题 In MSMQ on .NET, I'm using a MessageEnumerator to look through all the messages in the queue. I want to remove messages that meet a certain condition. When I call MoveNext to step through the queue, I get back a boolean to tell me if the current message exists. But, when I do a RemoveCurrent, how do I know if the current message after the removal exists? Is the only way to check Current and handle the exception? Here is an example where I use the simple condition of removing messages that are

Android MessageQueue

给你一囗甜甜゛ 提交于 2020-01-24 01:09:06
问题 We know main(UI) Thread is having implicit Looper attach with it so that its having MessageQueue. And we also know that we can attach MessageQueue to worker thread with the help of Looper.prepare() My question is that is it both Queue are same? 回答1: It's not the same MessageQueue , when you call Looper.loop() in a new thread, a new MessageQueue will attache to the new created thread. Then we usually use Handler to communicate with the thread. The main UI thread's MessageQueue is created by

Kafka: Cant Create Multiple Stream Consumers

本小妞迷上赌 提交于 2020-01-22 14:04:22
问题 I just got up and running with Kafka 0.8 beta 1. I have a really simple example up and running, the problem is, I can only get one message consumer to work, not several. That is, the runSingleWorker() method WORKS. The run() method DOES NOT WORK: import kafka.consumer.ConsumerIterator; import kafka.consumer.KafkaStream; import kafka.consumer.ConsumerConfig; import kafka.javaapi.consumer.ConsumerConnector; import java.util.Map; import java.util.List; import java.util.HashMap; import java.util

Message queue architecture (client to web server to worker and back)

陌路散爱 提交于 2020-01-22 05:50:12
问题 I have a web server written in Node JS running on Heroku. The server has a web server process and a worker process. The web server successfully sends messages to the worker via a RabbitMQ queue; the worker successfully returns the processed data to the web server. I use a randomly generated Uuid to track the messages and ensure the right message is paired up with the right original message. In a separate project, I have the client (website) successfully communicating with the web server. Now,

What's the purpose of Kafka's key/value pair-based messaging?

不想你离开。 提交于 2020-01-22 04:40:25
问题 All of the examples of Kafka | producers show the ProducerRecord 's key/value pair as not only being the same type (all examples show <String,String> ), but the same value . For example: producer.send(new ProducerRecord<String, String>("someTopic", Integer.toString(i), Integer.toString(i))); But in the Kafka docs, I can't seem to find where the key/value concept (and its underlying purpose/utility) is explained. In traditional messaging (ActiveMQ, RabbitMQ, etc.) I've always fired a message

ActiveMQ package for R

旧时模样 提交于 2020-01-17 04:57:05
问题 I'm trying to have a model I've built in R sent messages to an activeMQ queue. A quick googling of R points me to Rjms; however, when I check for the package on CRAN, I get an error saying "Package ‘Rjms’ was removed from the CRAN repository." Further googling just pushes me back to Rjms . Given this, is there an ActiveMQ package available in the R language? 回答1: You can install the current version from Github. First, you need to install the dependency Rjmsjars . library(devtools) install

ActiveMQ package for R

旧城冷巷雨未停 提交于 2020-01-17 04:56:13
问题 I'm trying to have a model I've built in R sent messages to an activeMQ queue. A quick googling of R points me to Rjms; however, when I check for the package on CRAN, I get an error saying "Package ‘Rjms’ was removed from the CRAN repository." Further googling just pushes me back to Rjms . Given this, is there an ActiveMQ package available in the R language? 回答1: You can install the current version from Github. First, you need to install the dependency Rjmsjars . library(devtools) install

How to add a new statement to an existing SQS QueuePolicy from another template?

孤街浪徒 提交于 2020-01-16 09:19:29
问题 I have 2 services with different Cloudformation YAML templates and want to add another policy to a queue policy defined in producer service (to allow consumer to receive and delete messages). However, my current solution simply overrides the existing policy instead of appending it (i. e., only consumer service role remains in the policy). This is Cloudformation template SQS part for producer: ProducerQueuePolicy: Type: AWS::SQS::QueuePolicy Properties: PolicyDocument: Version: '2012-10-17' Id

Publish message using exchange and routing key using MassTransit

雨燕双飞 提交于 2020-01-14 12:46:26
问题 I've been looking at MassTransit for a couple of weeks now and I'm curious about the possibilities. However, I don't seem to be able to get the concepts quite right. Expected behaviour I wanted to publish message to "direct" exchange with routing key which is bind to two different queue for performing other activities. When I attempted the same logic using MassTransit for better scalability. I've found MassTransit creates own exchange based on queue name with fanout type. Classic code to