message-queue

Why can I not get system V message queues working with fork()?

I have a program here: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/types.h> #include <sys/msg.h> #include <sys/wait.h> #include <errno.h> #include "linkedlist.h" #include "globals.h" #include "card.h" #include "logging.h" #include "stack.h" #include "servers.h" #include "player.h" #de...

System V Msg Queues on Linux don't work as expected.

I have the following application which replicates an issue I'm having in a larger application with system v message queues. basically, the main function generates a key, then creates a message queue with msgget(). Then 3 forks are spawned, each with a different id. each of them runs msgrcv with a different posative number (so they are wa...

Messaging, Queues and ESB's - I know where I want to be but not how to get there!

Hi, To cut a long story short, I am working on a project where we are rewriting a large web application for all the usual reasons. The main aim of the rewrite is to separate this large single application running on single server into many smaller decoupled applications, which can be run on many servers. Ok here's what I would like: I ...

Boost Message Queue not based on POSIX message queue? Impossible to select(2)?!

I thought I'd use Boost.Interprocess's Message Queue in place of sockets for communication within one host. But after digging into it, it seems that this library for some reason eschews the POSIX message queue facility (which my Linux system supports), and instead is implemented on top of POSIX shared memory. The interface is similar e...

Using POSIX message queues instead of TCP sockets - how to establish "connection"?

I have client and server programs which now communicate via TCP. I'm trying out using POSIX message queues instead (in cases where the client and server are on the same machine, of course). My hope is that it will improve performance (specifically via reduced latency). I've worked out most of it, but am not sure about one thing: how t...

Implementing a buffer-like structure in Python

I'm trying to write a small wsgi application which will put some objects to an external queue after each request. I want to make this in batch, ie. make the webserver put the object to a buffer-like structure in memory, and another thread and/or process for sending these objects to the queue in batch, when buffer is big enough or after c...

Waiting for messages in Managed Code

This is closely related to an earlier question. In the managed world: How do I check if the current thread has messages in its message queue? How do I yield to the OS and wait for a message in the current thread (like GetMessage or WaitMessage)? I am looking for the managed equivalents without PInvoke. ...

Advice on Python/Django and message queues

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 o...

Processing Messages from a Queue on a Delay using C# and VS.NET 2005

This is the setup for the queue: The queue is public and marked as transactional. A web service is responsible for inserting messages into the queue. A Windows service is listening in on the queue Given that, how can I only process messages that are at least 20 minutes old? ...

MSMQ vs Temporary Table Dump

Hi Guys, I know this question has been asked a bit before. But looking around I still cant make my mind up which route I should go down. Here's my scenario, hopefully you can help out: We will have a series of web services that will be hit on a scheduled basis by hundreds of mobile applications. These services will data on the device ...

Microsoft Service Inter-Communication Problem

I am currently building two windows services: The first takes messages from an internet connection and inserts these into a database. This is designed to be fast and stable and not do any other processing The second performs a batch process with any new messages that have arrived since it last ran. I am trying to think of a way so th...

IBM MQ for file transfer

We are facing a choice to use IBM MQ over SFTP for file transfer. I've heard advantages of such approach, but I've never see anyone actually using it for a large files. So main question: how well IMB MQ can handle transfer of large files (up to 100 MB)? Is it stable? It's from mainframe to UNIX server, if it does matter. Thanks a lot....

Queuing systems - what is a good way to start up multiple workers?

How have you set-up one or more worker scripts for queue-oriented systems? How do you arrange to startup - and restart if necessary - worker scripts as required? (I'm thinking about such tools as init.d/, Ruby-based 'god', DJB's Daemontools, etc, etc) I'm developing an asynchronous queue/worker system, in this case using PHP & Beansta...

How to output data form a thread to another thread without locking?

I'm developing a DirectShow application. I encounter a deadlock problem, the problem seems caused by acquire lock in a callback function called from a thread. This is the quest I asked in MSDN forum: http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/f9430f17-6274-45fc-abd1-11ef14ef4c6a Now I have to avoi...

How to set MQMD ApplicationID field via JMS API?

Hello, I'm using the JMS API to send messages to a Websphere MQ server. The application that pulls the messages i create want's me to set up the ApplicationID field in the MQMD structure to constant value. I could not find a way in the JMS API to access the MQMD structure The question: Is there a way doing this? if yes then how? If no, ...

Multi level queue design

I am designing a system to deal with an external web service. The service limits the number of requests that can be made over a certain period of time (T). The system allows for the batching of a certain number of requests (R). There are a certain number of operations that the service supports (O). My code will process an unknown num...

Memcache-based message queue for App Engine?

I'm working on a multiplayer game on App Engine and it needs a message queue (i.e., messages in, messages out, no duplicates or deleted messages assuming there are no unexpected cache evictions). Here are the memcache-based queues I'm aware of: MemcacheQ: http://memcachedb.org/memcacheq/ Starling: http://rubyforge.org/projects/starling...

Creating unique keys for a message quene for an app that can have multiple instances

I have made a Linux CUI app that communicates between processes via Message-quene. There is no problem with it as long as it is a single instance. However when there are multiple instances of the same app, the messages in the quene get sent to the wrong instance. I understand this can be avoided by giving the msgget function a unique k...

Message Queue Error: cannot find a formatter capable of reading message

I'm writing messages to a Message Queue in C# as follows: queue.Send(new Message("message")); I'm trying to read the messages as follows: Messages messages = queue.GetAllMessages(); foreach(Message m in messages) { String message = m.Body; //do something with string } However I'm getting an error message which says: "Cannot fin...

What's a good rate limiting algorithm?

I could use some pseudo-code, or better, Python. I am trying to implement a rate-limiting queue for a Python IRC bot, and it partially works, but if someone triggers less messages than the limit (e.g., rate limit is 5 messages per 8 seconds, and the person triggers only 4), and the next trigger is over the 8 seconds (e.g., 16 seconds la...