Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using callbacks to reply with Int or Enums is broken #5382

Closed
volak opened this issue May 16, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@volak
Copy link

commented May 16, 2019

Who's affected

Callback users on core 7.1.8 or 6.5.6 that uses int or enum values as response types.

Symptoms

Reply operations fail with an ArgumentNullException.

Backported to

User report

The latest update to MessageOperations.cs broke callbacks for me. I use context.Reply(1) and such - which now causes an argument null exception

[02:39:06.524 WRN UOW Executor] <UOWException> Received exception while processing message Library.Networking.Messages.Ping
domain_1        | System.ArgumentNullException: Value cannot be null.
domain_1        | Parameter name: messageType
domain_1        |    at new NServiceBus.Pipeline.OutgoingLogicalMessage(Type messageType, object message)
domain_1        |    at Task NServiceBus.MessageOperations.ReplyMessage(IBehaviorContext context, Type messageType, object message, ReplyOptions options)
domain_1        |    at async Task Aggregates.Internal.BulkInvokeHandlerTerminator.Terminate(IInvokeHandlerContext context)
domain_1        |    at async Task NServiceBus.SagaPersistenceBehavior.Invoke(IInvokeHandlerContext context, Func<IInvokeHandlerContext, Task> next)
domain_1        |    at async Task NServiceBus.LoadHandlersConnector.Invoke(IIncomingLogicalMessageContext context, Func<IInvokeHandlerContext, Task> stage)
domain_1        |    at async Task Aggregates.Internal.LogContextProviderBehaviour.Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
domain_1        |    at async Task NServiceBus.InvokeSagaNotFoundBehavior.Invoke(IIncomingLogicalMessageContext context, Func<IIncomingLogicalMessageContext, Task> next)
domain_1        |    at async Task Library.Validation.FluentValidationBehaviour.Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
domain_1        |    at async Task Aggregates.Internal.LocalMessageUnpack.Invoke(IIncomingLogicalMessageContext context, Func<Task> next)
domain_1        |    at async Task Aggregates.Internal.UnitOfWorkExecutor.Invoke(IIncomingLogicalMessageContext context, Func<Task> next)

Seems due to this change - f14473c#diff-59e8e774c2bd8041f702a3a0f23d4de2R120

Which runs the reply message object through IMessageMapper but doesn't account for if the message is not a mapped type.

Running the callbacks request/reply sample should confirm this bug

@andreasohlund

This comment has been minimized.

Copy link
Member

commented May 16, 2019

Good catch, the callbacks makes an unfortunate assumption that core will throw late enough so that callbacks can intercept. Raised #5383 to address this.

What's the urgency for a fix, are you able to run with 7.1.7 until we can get this released?

@andreasohlund andreasohlund self-assigned this May 16, 2019

@andreasohlund andreasohlund added the Bug label May 16, 2019

@volak

This comment has been minimized.

Copy link
Author

commented May 16, 2019

Its not crucial no - I'll just wait to update for a bit

Thanks

@andreasohlund

This comment has been minimized.

Copy link
Member

commented May 17, 2019

We've made this a prio so expect a fix to be out shortly

@andreasohlund andreasohlund added this to the 7.1.9 milestone May 20, 2019

@andreasohlund andreasohlund changed the title Bug - replying with int or enums broken Using callbacks to reply with Int or Enums broken May 20, 2019

@bording bording changed the title Using callbacks to reply with Int or Enums broken Using callbacks to reply with Int or Enums is broken May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.