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

Bus.InMemory events now expect either unobtrusive conventions or IEvent interface markers #1788

Closed
indualagarsamy opened this issue Nov 19, 2013 · 4 comments
Labels
Milestone

Comments

@indualagarsamy
Copy link
Contributor

Steps to repro:

  1. Declare a POCO for the inmemory event (not derived from IEvent), eg AuditMessageReceived
    https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Contracts/Operations/AuditMessageReceived.cs
  2. In a message handler, do an - in memory raise for the above event.
    https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Infrastructure/Satellites/AuditMessageImportSatellite.cs#L15

Notice the exception:

A first chance exception of type 'System.Exception' occurred in NServiceBus.Core.dll
An exception of type 'System.Exception' occurred in NServiceBus.Core.dll but was not handled in user code
Additional information: Could not find Metadata for 'ServiceControl.Contracts.Operations.AuditMessageReceived'.
Please ensure the following:
1. 'ServiceControl.Contracts.Operations.AuditMessageReceived' is included in initial scanning see File Scanning: http://particular.net/articles/the-nservicebus-host
2. 'ServiceControl.Contracts.Operations.AuditMessageReceived' implements either 'IMessage', 'IEvent' or 'ICommand' or alternatively, if you don't want to implement an interface, you can use 'Unobtrusive Mode' see: http://particular.net/articles/unobtrusive-mode-messages

NOTE: This used to work in 4.2 without adding any marker interfaces to the POCOs for in-memory events.

@andreasohlund
Copy link
Member

Based on a discussion with Indu today we believe that is can be a resonable
requirement and that we should consider changing this in 4.3 and point it
out clearly in the release notes?

On Tue, Nov 19, 2013 at 1:00 AM, Indu Alagarsamy
notifications@git.luolix.topwrote:

Steps to repro:

  1. Declare a POCO for the inmemory event (not derived from IEvent), eg
    AuditMessageReceived

https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Contracts/Operations/AuditMessageReceived.cs

  1. In a message handler, do an - in memory raise for the above event.
    https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Infrastructure/Satellites/AuditMessageImportSatellite.cs#L15

Notice the exception:

A first chance exception of type 'System.Exception' occurred in NServiceBus.Core.dll
An exception of type 'System.Exception' occurred in NServiceBus.Core.dll but was not handled in user code
Additional information: Could not find Metadata for 'ServiceControl.Contracts.Operations.AuditMessageReceived'.
Please ensure the following:

  1. 'ServiceControl.Contracts.Operations.AuditMessageReceived' is included in initial scanning see File Scanning: http://particular.net/articles/the-nservicebus-host
  2. 'ServiceControl.Contracts.Operations.AuditMessageReceived' implements either 'IMessage', 'IEvent' or 'ICommand' or alternatively, if you don't want to implement an interface, you can use 'Unobtrusive Mode' see: http://particular.net/articles/unobtrusive-mode-messages

NOTE: This used to work in 4.2 without adding any marker interfaces to the
POCOs for in-memory events.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1788
.

@johnsimons
Copy link
Member

Even though it is a resonable requirement, it still is a breaking change
that is not backwards compatible, so we either bump it to v5 or make it
backwards compliant.

On Tuesday, November 19, 2013, Andreas Öhlund wrote:

Based on a discussion with Indu today we believe that is can be a
resonable
requirement and that we should consider changing this in 4.3 and point it
out clearly in the release notes?

On Tue, Nov 19, 2013 at 1:00 AM, Indu Alagarsamy
<notifications@github.com <javascript:_e({}, 'cvml',
'notifications@github.com');>>wrote:

Steps to repro:

  1. Declare a POCO for the inmemory event (not derived from IEvent), eg
    AuditMessageReceived

https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Contracts/Operations/AuditMessageReceived.cs

  1. In a message handler, do an - in memory raise for the above event.

https://github.com/Particular/ServiceControl/blob/develop/src/ServiceControl/Infrastructure/Satellites/AuditMessageImportSatellite.cs#L15

Notice the exception:

A first chance exception of type 'System.Exception' occurred in
NServiceBus.Core.dll
An exception of type 'System.Exception' occurred in NServiceBus.Core.dll
but was not handled in user code
Additional information: Could not find Metadata for
'ServiceControl.Contracts.Operations.AuditMessageReceived'.
Please ensure the following:

  1. 'ServiceControl.Contracts.Operations.AuditMessageReceived' is
    included in initial scanning see File Scanning:
    http://particular.net/articles/the-nservicebus-host
  2. 'ServiceControl.Contracts.Operations.AuditMessageReceived' implements
    either 'IMessage', 'IEvent' or 'ICommand' or alternatively, if you don't
    want to implement an interface, you can use 'Unobtrusive Mode' see:
    http://particular.net/articles/unobtrusive-mode-messages

NOTE: This used to work in 4.2 without adding any marker interfaces to
the
POCOs for in-memory events.


Reply to this email directly or view it on GitHub<
https://github.com/Particular/NServiceBus/issues/1788>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1788#issuecomment-28778169
.

Regards
John Simons
NServiceBus

@SimonCropp
Copy link
Contributor

what @johnsimons said +1

@chrisbednarski
Copy link
Contributor

Shouldn't convention checks be done only on the main transport queue?
Issue #1471 has some more comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants