Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Publish a message in saga flow #4

Closed
simbanole opened this issue Apr 15, 2017 · 1 comment
Closed

Publish a message in saga flow #4

simbanole opened this issue Apr 15, 2017 · 1 comment

Comments

@simbanole
Copy link

In the starbucks sample, I saw a message is published when payment is completed.
The code is like
When(PaymentComplete)
.Then((saga, message) =>
{
Console.WriteLine("Payment Complete for '{0}' got it!", saga.Name);
saga.ServeDrink();
})
.Complete()

private void ServeDrink()
{
Console.WriteLine(string.Format("I've got a {0} ready for {1}!", Drink, Name));

        var message = new DrinkReadyMessage
        {
            CorrelationId = CorrelationId,
            Drink = Drink,
            Name = Name,
        };

        Bus.Publish(message);
    }

The starbucks sample uses Masstransit 2.9, how can this be realized with MassTransit 3.5?

@phatboyg
Copy link
Member

I'd suggest looking at a newer sample, one that is built on the new code.

Many are listed here: http://masstransit-project.com/MassTransit/learn/samples/

Also, there is a very complete sample with presentation at: https://github.com/phatboyg/Demo-Registration

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

No branches or pull requests

2 participants