Returning error from AMQP participant

9 views
Skip to first unread message

hading2

unread,
Aug 25, 2011, 1:08:13 PM8/25/11
to ruote
Hi,

Please forgive me if this is a FAQ, but I've searched around the
documentation and this group and haven't been able to come up with an
answer.

I'm working on using Ruote in conjunction with AMQP participants.
Normal operation works fine. However, I can't seem to figure out how a
participant is supposed to report back to the engine when an error
condition arises so that the Ruote error handling mechanisms will come
into play.

More concretely, since the only way it has to communicate with the
engine at all is to push something back on to the reply queue I assume
that where I would normal push back the JSON-serialized workitem I
instead need to push something else constructible from the workitem
and the error, but I can't seem to find anywhere what that might be.

Thanks for any pointers,
Howard

Kit Plummer

unread,
Aug 25, 2011, 1:19:19 PM8/25/11
to openwfe...@googlegroups.com
Hey Howard.

We pack a workitem['fields']['__error__'] that gets received on the reply queue, and then insert those errors with the @context.error_handler.action_handle().

Are you using RuoteAMQP?

Kit

-- 
Kit Plummer :: MaestroDev :: 520.360.4729

--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to openwfe...@googlegroups.com
to unsubscribe : send email to openwferu-use...@googlegroups.com
more options : http://groups.google.com/group/openwferu-users?hl=en

hading2

unread,
Aug 25, 2011, 1:24:18 PM8/25/11
to ruote
Hi Kit,

Yes, this is with Ruote 2.2.0 and RuoteAMQP 2.2.0.

So then is there a modification to the receive method of
RuoteAMQP::Receiver? I wasn't sure if RuoteAMQP had a standard way of
dealing with this (even after digging through the code).

Would it be possible to trouble you for a small example?

Thanks,
Howard
> > to post : send email to openwfe...@googlegroups.com (mailto:openwfe...@googlegroups.com)
> > to unsubscribe : send email to openwferu-use...@googlegroups.com (mailto:openwferu-use...@googlegroups.com)
> > more options :http://groups.google.com/group/openwferu-users?hl=en

Kit Plummer

unread,
Aug 25, 2011, 1:33:55 PM8/25/11
to openwfe...@googlegroups.com
Howard.

Hopefully this helps. Yes, we _extend_ the receiver.

https://gist.github.com/1171232

Mind you we're not using RuoteAMQP, but a port to Stomp that works that same way.

Kit

--
Kit Plummer :: MaestroDev :: 520.360.4729


On Thursday, August 25, 2011 at 10:24 AM, hading2 wrote:

> Hi Kit,
>
> Yes, this is with Ruote 2.2.0 and RuoteAMQP 2.2.0.
>
> So then is there a modification to the receive method of
> RuoteAMQP::Receiver? I wasn't sure if RuoteAMQP had a standard way of
> dealing with this (even after digging through the code).
>
> Would it be possible to trouble you for a small example?
>
> Thanks,
> Howard
>

hading2

unread,
Aug 25, 2011, 1:50:55 PM8/25/11
to ruote
Hi Kit,

Thanks. Seems fairly straightforward. I guess I looked enough that I
suspected there wasn't a standard way to do it, but I wanted to make
sure first.

Thanks,
Howard

Kenneth Kalmer

unread,
Aug 25, 2011, 2:19:52 PM8/25/11
to openwfe...@googlegroups.com

Hi Howard

I wanted to chime in as well. What we did is more or less the
following (using daemon-kit on the remote side):

Unhandled exceptions in the remote participant get caught and packed
into an 'error' field, which is then inspected as part of the process
definition, something like this: https://gist.github.com/1171321

It has worked really well for us.

HTH

--
Kenneth Kalmer
kenneth...@gmail.com
http://opensourcery.co.za
@kennethkalmer

hading2

unread,
Aug 25, 2011, 2:25:45 PM8/25/11
to ruote
Hi Kenneth,

Thanks for your suggestion. I'd considered something like this as
well, but had some fear that for our needs too much stuff would wind
up adorned with checks for the error field. There may be situations
where something like it will come in handy for us though.

Thanks,
Howard
Reply all
Reply to author
Forward
0 new messages