Okay...so what you need in any case is something that keeps track of what users are currently being handled. A message comes in, the set/tree/hash that tracks the users in use is checked, and if the two users aren't in it then entries are made for them and the message gets handled; the message handler then tells the tracker when it's done.
If a message comes in and there's entries for one or both of the users, then that message is added onto linked lists anchored by the user entries in the hash, so that when a handler announces freed users, then entries in the lists for those users are fetched and handled. Listener's never blocked, JMS queue's kept clean, no re-queueings, and thread pool size is independent of user base. Possible sequencing issues, but not for a given user pair. On Mon, Nov 8, 2010 at 11:03 AM, Krystian <[email protected]> wrote: > > Hi guys, > > thanks for the info about ActiveMQ message groups, it would work > perfectly... unfortunately my solution is a tad more complicated. > I didn't go into detail in the first message, sorry about that. > One action concerns 2 users. It is an action between two of them. So my > message, which is actually a Map Message contains two fields: > userA, userB > Depending on the initiator of the action, this user will be userA and the > other user will be userB. > > So i unfortunately cannot create groups with userId, simply because I always > have 2 and none of them can participate in any other action when this one is > executed. > So it I have: > userA, userB, userC, userD and get this actions: > 1. userA, userB > 2. userB, userC > 3. userC, userD > > I want the first one to run, the second one to wait and the third one to > run. Then when the first action is done and the third action is done the > second one can be executed. > If I were to use message groups I would not be able to create groups in a > way where message 1,2 and 3 would end up on the same queue. > > A little bit complicated, yes, but these are the requirements :( > -- > View this message in context: > http://camel.465427.n5.nabble.com/Cannot-reply-to-a-message-routed-by-camel-tp3254431p3255253.html > Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. >
