c# - MassTransit - Consumer throws Exception / Publisher times out waiting for response -


i using masstransit , have following-ish code in app:

requestmsg request = buildmearequest();                sometypeofresponse response = null;  _servicebus.publishrequest(request, c =>     {         c.handle<sometypeofresponse>(message => response = message);         c.settimeout(timespan.fromseconds(30));     });  return response; 

and on consumer side, have this:

public class requestmsgconsumer : consumes<t>.all {     public requestmsgconsumer(iservicebus servicebus)     {          _servicebus = servicebus;     }      public void consume(requestmsg request)     {         sometypeofresponse response = doworktogetresponse(request);          _servicebus.context().publish(response);     } } 

this works great when goes ... if doworktogetresponse(request) throws exception (or portion of consume() method really) original requestor times out, there no indication of failure.

my original idea build class either<exception, sometypeofresponse> requester expects either<> construct, going force me try/catch every consume method - , there plenty of them.

has else solved more elegantly?

i believe want add c.handlefault(fault => ...) publishrequest.

if doesn't work, there's been couple messages on mailing list past week or 2 on how fixes in next release. think failures limited sagas wrong.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -