Closed frostebite closed 6 years ago
Can I see the code in EventBusService
that makes the call to SendRequest
?
it's super simple. Just calling SendRequest
I'm adding rebus like this
services.AddRebus(configure => configure
.Logging(l =>
{
l.Trace();
})
.Transport(t =>
{
t.UseInMemoryTransport(new InMemNetwork(true), "default");
})
.Subscriptions(s=>
{
s.StoreInMemory();
})
.Options(o =>
{
o.LogPipeline(verbose:true);
o.SetNumberOfWorkers(workers);
o.SetMaxParallelism(parallelism);
o.EnableSynchronousRequestReply(30);
o.SimpleRetryStrategy(
maxDeliveryAttempts:1
);
})
.Routing(r =>
{
r.TypeBased()
.MapFallback("default")
.Map<bool>("default")
.Map<EventHandlerPayloadBase>("default");
}));
I'm sending with this:
await memBus.SendRequest
I get this and then I get this:
c4c90ae4-b065-4f81-b4fd-ce6b07393da5 ---> default (In-mem network 1) 248dffa0-ab60-4e78-9178-b6448e777a42 ---> default (In-mem network 1) default ---> 248dffa0-ab60-4e78-9178-b6448e777a42 (In-mem network 1) default ---> c4c90ae4-b065-4f81-b4fd-ce6b07393da5 (In-mem network 1) request-reply:f099f206-2562-44de-a5f9-a911b38297af ---> default (In-mem network 1) default ---> request-reply:f099f206-2562-44de-a5f9-a911b38297af (In-mem network 1) default ---> request-reply:f099f206-2562-44de-a5f9-a911b38297af (In-mem network 1) request-reply:f099f206-2562-44de-a5f9-a911b38297af ---> error (In-mem network 1)
when firing a simple request on startup in the Configure services method of a netcore api
public async Task processMessage(EventHandlerPayloadBase baseRequest)
{
try
{
if(acceptedHandlers.Contains(baseRequest.GetType()))
{
_logger.LogInformation(new
{
message = "Handler found, executing",
label = baseRequest.label,
handlers = acceptedHandlers.Select(x => x.Name),
type = baseRequest.GetType().Name
}.ToJson());
await memBus.SendRequest<bool>(baseRequest, null, TimeSpan.FromMinutes(6));
}
else
{
_logger.LogInformation(new
{
message = "No handler for event skipping",
label = baseRequest.label,
handlers = acceptedHandlers.Select(x => x.Name),
type = baseRequest.GetType().Name
}.ToJson());
}
}
catch (Exception ex)
{
_logger.LogError(new
{
error = "true",
message = ex.Message,
stack = ex.StackTrace,
type = ex.GetType().GetType().Name,
exception = ex
}.ToJson());
throw ex;
}
}
is that method if it helps
@mookid8000 Any idea at all from glancing? Anything I could provide?
So when do you get the exception?
Could you maybe post the entire exception, including the full stack trace?
That latest thing running locally produces no exception just halts the program and the console says that thing with request reply error
Ok. I'll see if I can get time to investigate this tomorrow.
Hi @frostebite , sorry – I never got this done, and then vacation happened.... 🌞 what's the status? Have you figured something out?
If not, could you maybe try and reproduce the problem in a small program and send it to me?
Hi @frostebite , any chance you can tell me more about what you're trying to achieve, and how you're trying to do it?
From your code it seems strange to me that your processMessage
method seems to handle a request of some kind (EventHandlerPayloadBase
), but then it uses the SendRequest
to send it somewhere else, effectively blocking until a reply is received.
It's a little bit hard for me to get an understanding of what you want to achieve from the code you posted, so I think it might help if you tell me some more about it.
Closing this one for now. Feel free to resume the discussion if it hasn't been resolved somehow.
I'm getting the following exception.
No idea why. Any help appreciated
my local tests work just fine by not when run on a cloud machine?
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() at DocWorks.BuildingBlocks.EventBus.Implementation.EventBusService.