Shutdown cleanup for unprocessed messages

10 views
Skip to first unread message

Robert M.

unread,
Aug 31, 2008, 5:47:20 PM8/31/08
to retlang-dev
- What happens with the messages published in the bus queue, but which
did not have the chance to get processed in case of shutdown?

- How can I perform an action on those messages in a cleanup
procedure? For example, I want to save all unprocessed messages found
in the bus queue to disk.


Regards,
Robert

Mike Rettig

unread,
Aug 31, 2008, 9:35:34 PM8/31/08
to retla...@googlegroups.com
Messages published to the Fiber after dispose is called will be ignored. Disposal also ends all subscriptions, so new messages should not be delivered to the Fiber.  Similarly, scheduled executions are canceled.

Why do you need to save the messages to disk? Jetlang is not a guaranteed messaging system. If you want guaranteed delivery, then a persistent messaging solution such as JMS would be a better choice. 

Mike

Robert M.

unread,
Sep 1, 2008, 9:56:54 AM9/1/08
to retlang-dev
I am using Retlang not Jetlang. :-)

I am trying to use Retlang as a mechanism for minimizing locking in a
possibly highly concurrent system in a pipe and filters architecture
style . Messages need to be saved at the end so that I can continue
to process them at the next startup. I don't want to save them in
between processing. My problem is that I at the shutdown I might have
a significant number of messages which did not finish their travel
through the pipe&filters which represent a flow in the application and
an external user might try to query at any time for the processed
messages. Using MSMQ or other queuing system other than in process
memory might have a certain "artificial" latency during processing and
will limit my throughput. I will make some tests in order not to be
base my judgment on assumptions, but still I would like to base my app
on in process Retlang messaging rather than out of process MSMQ.

Can I intercept at any stage during shutdown the disposal of the
queued messages and get a reference to them in order to have the
chance to save them?



On Sep 1, 4:35 am, "Mike Rettig" <mike.ret...@gmail.com> wrote:
> Messages published to the Fiber after dispose is called will be ignored.
> Disposal also ends all subscriptions, so new messages should not be
> delivered to the Fiber.  Similarly, scheduled executions are canceled.
>
> Why do you need to save the messages to disk? Jetlang is not a guaranteed
> messaging system. If you want guaranteed delivery, then a persistent
> messaging solution such as JMS would be a better choice.
>
> Mike
>

Mike Rettig

unread,
Sep 4, 2008, 8:34:14 PM9/4/08
to retla...@googlegroups.com
The ProcessThread takes ICommandQueue object. At startup inject your own CommandQueue instance and retain a reference, then at shutdown you can store any remaining messages.

Mike
Reply all
Reply to author
Forward
0 new messages