Giter Club home page Giter Club logo

Comments (7)

mookid8000 avatar mookid8000 commented on July 28, 2024 2

I just coded up this example: https://github.com/rebus-org/Rebus/blob/master/Rebus.Tests/Examples/SagaSendsMessagesToItself.cs

It demonstrates how an in-mem saga can send a bunch of messages to itself, which will not actually be sent until the saga data is saved. Moreover, it shows that all subsequent messages get dispatched with optimistic concurrency.

Could you maybe take a look at the example to see where your code differs?

from rebus.

dazinator avatar dazinator commented on July 28, 2024

Thank you, I will investigate

from rebus.

dazinator avatar dazinator commented on July 28, 2024

One thing at a glance before I get into running the two examples, I use "bus.Send" not "bus.SendLocal" not sure if that makes any difference. The messages sent are routed to another bus's handler, which uses bus.Send() to route messages back to be handled by this saga.

from rebus.

mookid8000 avatar mookid8000 commented on July 28, 2024
await bus.SendLocal(...);

just means that the the bus will

await bus.Send(...);

with itself as the destination. If you were to explicitly configure the equivalent, it would be something like

services.AddRebus(
	configure => configure
		.Transport(t => t.Use(..., "my-queue"))
		.Routing(r => r.TypeBased().Map<SomeMessage>("my-queue"))
);

// (...)

await bus.Send(new SomeMessage());

from rebus.

mookid8000 avatar mookid8000 commented on July 28, 2024

Hi @dazinator , did you figure out how your code differed from my example?

from rebus.

dazinator avatar dazinator commented on July 28, 2024

Hi @dazinator , did you figure out how your code differed from my example?

I haven't got back into the issue again just yet sorry, but this does seem like a difference.. your example uses SendLocal to route back to the same bus. My test has two buses, and my sage sends a message which is routed to the other bus (different input queue name) which handles it and sends a message back to my saga bus input queue. Both buses are sharing an in memory network created at the start of the test.

from rebus.

mookid8000 avatar mookid8000 commented on July 28, 2024

Yeah ok, but as mentioned in the previous comment, it doesn't affect how the message is sent, only where it is sent to.

All other things being equal, await bus.SendLocal(..) should not take as long as await bus.Send(..) followed by await bus.Reply(...) in the other end, so to try to reproduce your issue, await bus.SendLocal(..) would seem like an sharper bet.

from rebus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.