On Wed, Jun 22, 2011 at 07:46:25PM +0200, Mario Camou wrote: > > I have a participant/receiver combination that extends > RuoteAMQP::ParticipantProxy / RuoteAMQP::Receiver. The Participant doesn't > call reply_to_engine in consume(), it just registers the workitem in an > in-memory Hash and returns. The Receiver looks up the workitem in the Hash > when it gets a message and does the receive (or a launch if there is no > corresponding workitem).
Hello Mario, note that you don't have to save the workitem in a hash like you do. The engine already did that for you (although it did in the storage). You can retrieve the workitem later by doing in the participant : ---8<--- emitted_workitem = applied_workitem(fei_or_received_workitem) --->8--- This method comes from Ruote::LocalParticipant (and Ruote::ReceiverMixin). > What happens if Ruote goes down after the execution of the Participant but > before the Receiver gets the message? Will the workitem be persisted (so I > should probably persist the Hash too) or not? > > In my use case I think it makes more sense for it NOT to be persisted. As a > matter of fact, I'm thinking of flushing the AMQP queue before starting up > so we don't have any backed-up messages. Your implementation saves before (or right after emitting the workitem over the AMQP wire). It seems you care about the workitem. I'd suggest using the applied_workitem as shown above. Best regards, -- John Mettraux - http://jmettraux.wordpress.com -- you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en
