You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the Publish().MessagesFromXXX().ToYYY() syntax ignores whatever was specified by ToYYY(). The equivalent Action overload Publish(p => p.MessagesFromXXX().ToYYY())does work as expected.
As far as I can tell, it comes down to Publish() not assigning AutoAddSubscriptions = true, though based on that method's description it appears intentional. The problem is that, without AutoAddSubscriptions, the subscription is never added to the endpoint because the only other method that does so is AttachSubscriptions which is not public and is not called as part of the Publish().MessagesFromXX().ToYYY() chain (though it is called from the Action overload, which explains why that works).
The result of this appears to depend on the endpoint:
cascading messages returned by an HTTP endpoint (as additional tuple values) get added to the LocalRouting source and so are routed locally
cascading messages returned by regular message handlers don't appear in any routing source and so are ignored (via EmptyMessageRouter)
My initial reaction was to submit a PR that adds AutoAddSubcriptions = true to Publish() since there's no other way for the subscriptions to be added to the endpoint, but the wording of the code comments gave me pause. I am confused as to what use cases require the subscription never being added to the endpoint, though.
I'll leave it with you to provide direction, but I'm still happy to actually make the PR.
To Reproduce
It's worth noting that typeof(SomeType).Assembly is not the entrypoint assembly in my usecase (just in case there's some auto wiring of entry messages that would prevent this issue from being reproducable)
This does not work:
opts.Publish().MessagesFromAssembly(typeof(SomeType).Assembly)
.ToKafkaTopic("test"); // Though it doesn't appear specific to Kafka
Describe the bug
Using the
Publish().MessagesFromXXX().ToYYY()
syntax ignores whatever was specified byToYYY()
. The equivalent Action overloadPublish(p => p.MessagesFromXXX().ToYYY())
does work as expected.As far as I can tell, it comes down to
Publish()
not assigningAutoAddSubscriptions = true
, though based on that method's description it appears intentional. The problem is that, withoutAutoAddSubscriptions
, the subscription is never added to the endpoint because the only other method that does so isAttachSubscriptions
which is not public and is not called as part of thePublish().MessagesFromXX().ToYYY()
chain (though it is called from the Action overload, which explains why that works).The result of this appears to depend on the endpoint:
EmptyMessageRouter
)My initial reaction was to submit a PR that adds
AutoAddSubcriptions = true
toPublish()
since there's no other way for the subscriptions to be added to the endpoint, but the wording of the code comments gave me pause. I am confused as to what use cases require the subscription never being added to the endpoint, though.I'll leave it with you to provide direction, but I'm still happy to actually make the PR.
To Reproduce
It's worth noting that
typeof(SomeType).Assembly
is not the entrypoint assembly in my usecase (just in case there's some auto wiring of entry messages that would prevent this issue from being reproducable)This does not work:
This works:
Expected behavior
I'd expect the two above snippets to be functionally equivalent
The text was updated successfully, but these errors were encountered: