Is it possible to create a generic fault handler/consumer?

1,099 views
Skip to first unread message

Stanislav Perekrestov

unread,
Jun 15, 2012, 11:38:14 AM6/15/12
to masstrans...@googlegroups.com
Hello. 

I'm trying to create a notification service that listens to faults and sends notifications to developers.

All my messages inherit the common interface - IMessage

So, when any message consumption fails I'd like to handle a fault message in a generic way.

public class FaultMessagesEmailNotificationConsumer : Consumes<Fault<IMessage>>.All
{
///..
        }


It seems that the mentioned approach doesn't work right now and I have to specify all message types as Fault<> type arguments directly instead of using the common interface.
Is there any way to achieve the mentioned behavior?

Thanks in advance.

Dru Sellers

unread,
Jun 15, 2012, 11:39:25 AM6/15/12
to masstrans...@googlegroups.com
so, to be clear. you want to receive a message for ANY fault, but you don't care about the actual data in the message?

-d

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/lp8HwNPaMbsJ.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

Stanislav Perekrestov

unread,
Jun 15, 2012, 11:41:46 AM6/15/12
to masstrans...@googlegroups.com
Yes, that's right. I  just  want  to send an email with fault details  (stacktraces, fault date etc.)  to developers 


On Friday, June 15, 2012 6:39:25 PM UTC+3, Dru wrote:
so, to be clear. you want to receive a message for ANY fault, but you don't care about the actual data in the message?

-d

On Fri, Jun 15, 2012 at 10:38 AM, Stanislav Perekrestov <perekres...@gmail.com> wrote:
Hello. 

I'm trying to create a notification service that listens to faults and sends notifications to developers.

All my messages inherit the common interface - IMessage

So, when any message consumption fails I'd like to handle a fault message in a generic way.

public class FaultMessagesEmailNotificationConsumer : Consumes<Fault<IMessage>>.All
{
///..
        }


It seems that the mentioned approach doesn't work right now and I have to specify all message types as Fault<> type arguments directly instead of using the common interface.
Is there any way to achieve the mentioned behavior?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/lp8HwNPaMbsJ.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

Stanislav Perekrestov

unread,
Jun 26, 2012, 4:12:51 AM6/26/12
to masstrans...@googlegroups.com
There is a workaround that uses some reflection "magic":

On Monday, June 25, 2012 3:38:25 PM UTC+3, Christoph wrote:
Any news on this topic? Would be interesting, as I currently have the same requirement.

Dru Sellers

unread,
Jun 26, 2012, 10:34:45 AM6/26/12
to masstrans...@googlegroups.com
@chris - thoughts?

-d

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/EKvQW-6QSvAJ.

To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.

Chris Patterson

unread,
Jun 27, 2012, 1:15:01 AM6/27/12
to masstrans...@googlegroups.com
We will add a base non-generic type Fault that will be the base interface of the other fault messages. 

--
Chris Patterson

Emir Ključanin

unread,
Mar 9, 2018, 3:58:45 PM3/9/18
to masstransit-discuss
Anything on this one? :)


On Wednesday, June 27, 2012 at 7:15:01 AM UTC+2, Chris Patterson wrote:
We will add a base non-generic type Fault that will be the base interface of the other fault messages. 

--
Chris Patterson


On Jun 26, 2012, at 7:34 AM, Dru Sellers <d...@drusellers.com> wrote:

@chris - thoughts?

-d

On Tue, Jun 26, 2012 at 3:12 AM, Stanislav Perekrestov <perekres...@gmail.com> wrote:
There is a workaround that uses some reflection "magic":

On Monday, June 25, 2012 3:38:25 PM UTC+3, Christoph wrote:
Any news on this topic? Would be interesting, as I currently have the same requirement.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/EKvQW-6QSvAJ.

To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsub...@googlegroups.com.

Alex Wheat

unread,
Mar 9, 2018, 8:18:23 PM3/9/18
to masstransit-discuss

Emir Ključanin

unread,
Mar 10, 2018, 2:56:17 AM3/10/18
to masstransit-discuss
Awesome :). TY

Chris Patterson

unread,
Mar 10, 2018, 9:44:50 AM3/10/18
to masstrans...@googlegroups.com
Holy thread necrophilia Batman!

Yes, that was added _years_ ago...


On Sat, Mar 10, 2018 at 1:56 AM, Emir Ključanin <emir.kl...@gmail.com> wrote:
Awesome :). TY


On Saturday, March 10, 2018 at 2:18:23 AM UTC+1, Alex Wheat wrote:
https://stackoverflow.com/questions/48623670/masstransit-one-fault-consumer-for-all-fault-message

On Friday, March 9, 2018 at 3:58:45 PM UTC-5, Emir Ključanin wrote:
Anything on this one? :)

On Wednesday, June 27, 2012 at 7:15:01 AM UTC+2, Chris Patterson wrote:
We will add a base non-generic type Fault that will be the base interface of the other fault messages. 

--
Chris Patterson


On Jun 26, 2012, at 7:34 AM, Dru Sellers <d...@drusellers.com> wrote:

@chris - thoughts?

-d

On Tue, Jun 26, 2012 at 3:12 AM, Stanislav Perekrestov <perekres...@gmail.com> wrote:
There is a workaround that uses some reflection "magic":

On Monday, June 25, 2012 3:38:25 PM UTC+3, Christoph wrote:
Any news on this topic? Would be interesting, as I currently have the same requirement.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/EKvQW-6QSvAJ.

To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsubscribe...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-discuss+unsubscribe...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/masstransit-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/5479211d-e4c5-4f09-b954-480cab9472ef%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jack Ni

unread,
Mar 13, 2018, 7:27:58 PM3/13/18
to masstransit-discuss
I guess, I will do middleware for that. before the message get to the queue again, you can check the status and decide what you want to do with it
Reply all
Reply to author
Forward
0 new messages