queue

How to set queue max length for activemq

房东的猫 提交于 2019-12-12 16:18:35
问题 I'm wondering if I can configure a queue's max length on activemq, so that when the queue's length touch the limit, the enqueue operation will failed or throw exceptions. is anybody know about this question? any help will be very appreciated. Thanks a lot. 回答1: Take a look at Producer Flow Control http://activemq.apache.org/producer-flow-control.html It limits your queue on the amount of memory the queue takes so its not a numbers of messages approach but a memory sizing approach. You can

Creating JMS Queues at runtime [closed]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 16:14:15
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I am working on an application where the app user can create / delete queues . Also , he would be able to move a message from 1 queue to another, delete a message , rearrange the messages in the queue based on some filter. One possible design is to use activemq for queues and

Queueing up Service Calls

落花浮王杯 提交于 2019-12-12 15:51:25
问题 I'm implementing a Silverlight application that uses WCF services heavily, I've got to the point now where occasionally there are several long service calls that block other service calls from running. These service calls eventually time out. I'd like to see if its possible to a queue system that executes service calls one after another, this way long calls will hold up other calls but won't cause them to timeout. I'm using service agents to wrap the service calls public interface

Implementing Queue for data to be inserted in the database

被刻印的时光 ゝ 提交于 2019-12-12 15:21:25
问题 We are developing a vehicle tracking system in which several GPS devices keep sending their GPS locations to the server using TCP connection. The TCP communicator decodes the GPS location and inserts that data into the database. Right now, one thread of TCP communicator serves one device request. After decoding the GPS data, it creates a connection to the database and inserts the data and releases the connection. As number of devices are increasing, the number of concurrent connections to the

How to make sure my event is handled by only one instance of my app?

[亡魂溺海] 提交于 2019-12-12 15:04:08
问题 In our architecture we have a Redis server we use for caching and for publishing event. My problem is the following I have an message called "CustomerUpdate" I have 1 application listening to this message 3 instance (server) of this application are being executed for scalability 1 instance of the database is running One of the handler for this message will update the database Some other handler will erase memory cache or do something local to the instance Is there any pattern for making sure

Grails non time based queuing

白昼怎懂夜的黑 提交于 2019-12-12 14:35:25
问题 I need to process files which get uploaded and it can take as little as 1 second or as much as 10 minutes. Currently my solution is to make a quartz job with a timer of 30 seconds and then process and arbitrary job whenever it hits. There are several problems with this. One: if the job will take less than a few seconds it is wasteful to make things wait 30 seconds for the job queue. Two: if there is only one long job in the queue it could feasibly try to do it twice. What I want is a timeless

Retry HTTP(S) POSTs until they succeed on Android

最后都变了- 提交于 2019-12-12 13:12:20
问题 I have some data which will be sent from an Android app to a server via http(s). It needs to be sent in-order. Does there already exist a way of queuing http requests (for the same server) and retrying them until they complete (not necessarily succeed)? My problem is that http requests may fail if there is not network coverage. There should be some form of exponential back-off, or a listener (for network reconnection) to prompt retrying the head of the queue. I can write this myself, but I

Multiprocessing queue batch get up to max N elements

廉价感情. 提交于 2019-12-12 12:48:00
问题 I need to get as many items as I can from a queue (up to N), in a blocking fashion. e.g: queue.get(16) Should return up to 16 elements, but block if empty. 回答1: There's no such facility built in, so you'll need to code it yourself; for example, import queue # in Python 3; Queue in Python 2 ... def getn(q, n): result = [q.get()] # block until at least 1 try: # add more until `q` is empty or `n` items obtained while len(result) < n: result.append(q.get(block=False)) except queue.Empty: pass

Persistent Akka Mailboxes and Losslessness

主宰稳场 提交于 2019-12-12 12:24:18
问题 In Akka, when an actor dies while processing a message (inside onReceive(...) { ... } , that message is lost. Is there a way to guarantee losslessness? Is there a way to configure Akka to always persist messages before sending them to onReceive , so that they can be recovered and replayed when the actor does die? Perhaps something like a persistent mailbox? 回答1: Yes, take a look at Akka Persistence, in particular AtLeastOnceDelivery. This stores messages on the sender side in order to also

Does this seem like a reasonable approach to a concurrent set/queue combo?

和自甴很熟 提交于 2019-12-12 12:18:30
问题 Update : As Brian pointed out, my original idea did indeed have a concurrency issue. This was somewhat obscured by the signature of the ConcurrentDictionary<TKey, TValue>.AddOrUpdate method, which can lull a lazy thinker (like myself) into believing that everything--the set add as well as the queue push--will somehow happen all at once, atomically (i.e., magically). In retrospect, it was foolish of me to have this expectation. In fact, regardless of the implementation of AddOrUpdate , it