I'm an MT noob, and I was wondering if it's possible to alter the itinerary of an executing routing slip? Specifically, is it possible to dynamically add an activity to the itinerary based on the outcome of an activity? Any information would be greatly appreciated.
--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/8adf7a1b-334d-42a2-aca5-4ac3b24858e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var builder = new RoutingSlipBuilder(NewId.NextGuid());
Uri scanAddress = new Uri("rabbitmq://127.0.0.1/msg/execute_scan");
System.Action<ItineraryBuilder> a = (RoutingSlipBuilder) => builder.AddActivity("scan", scanAddress);
return context.ReviseItinerary(a);
Yes, that's fully supported.You can build the itinerary inside that method (in this case it just empties it).
On Tue, Jun 27, 2017 at 9:14 PM, Landon Campbell <campbel...@hotmail.com> wrote:
I'm an MT noob, and I was wondering if it's possible to alter the itinerary of an executing routing slip? Specifically, is it possible to dynamically add an activity to the itinerary based on the outcome of an activity? Any information would be greatly appreciated.
--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
var builder = new RoutingSlipBuilder(NewId.NextGuid());
Uri scanAddress = new Uri("rabbitmq://127.0.0.1/msg/execute_scan");
return context.ReviseItinerary(x => builder.AddActivity("scan", scanAddress));
"messageType": [
"urn:message:MassTransit.Courier.Contracts:RoutingSlipRevised"
],
And then there's this:
"itinerary": [],
"discardedItinerary": [
{
"name": "resultsAnalysis",
"address": "rabbitmq://127.0.0.1/msg/execute_resultsAnalysis",
"arguments": {}
}
]I am receiving the "RoutingSlipCompleted" message, but obviously when I try to revise the itinerary, it clears it instead of adding the new activity. So, I don't guess "AddActivity" is what I want to be using...
Don't create a routing slip builder in your activity. The lambda argument you receive in the ReviseItinerary call is what you should be using to build the new itinerary. There are methods on that argument to add the original itinerary activities as well.
How is this not obvious? Why would you ever think to create a separate object instance with no coupling to the delegate argument? Just surprised it isn't more clear.
__
Chris Patterson
From: masstrans...@googlegroups.com <masstrans...@googlegroups.com> on behalf of Landon Campbell <campbel...@hotmail.com>
Sent: Tuesday, June 27, 2017 11:15:09 PM
To: masstransit-discuss
Subject: Re: [masstransit-discuss] Add Activities to Routing Slip from Activity?
Sorry for the barrage of replies, just want to make sure I'm providing all the pertinent information. I added some event handlers, and noticed the following message for the slip that I'm trying to add an activity to. The message type is:--"messageType": [
"urn:message:MassTransit.Courier.Contracts:RoutingSlipRevised"
],And then there's this:"itinerary": [],
"discardedItinerary": [
{
"name": "resultsAnalysis",
"address": "rabbitmq://127.0.0.1/msg/execute_resultsAnalysis",
"arguments": {}
}
]I am receiving the "RoutingSlipCompleted" message, but obviously when I try to revise the itinerary, it clears it instead of adding the new activity. So, I don't guess "AddActivity" is what I want to be using...
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsubscribe...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/bbb5d5b5-a72e-4df7-b355-f080031e0b6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/09306bb6-eba0-4ebe-a004-1f0b4b2075d6%40googlegroups.com.