In the Starbucks example, prior to the customer publishing the NewOrderMessage, the following code is present:if (_unsubscribeToken != null)_unsubscribeToken();_unsubscribeToken = Bus.SubscribeInstance(this);I'm trying to understand the purpose of the unsubscribe token and when it's needed/not needed. However, the example app seems to be broken in the following scenario:
- Customer sends NewOrderMessage#1
- Cashier processes NewOrderMessage#1 and publishes PaymentDueMessage#1
- Barista processes NewOrderMessage#1
- Customer processes PaymentDueMessage#1 and publishes SubmitPaymentMessage#1
- Cashier processes SubmitPaymentMessage#1 and publishes PaymentCompleteMessage#1
- Prior to Barista completing processing of NewOrderMessage#1 Customer publishes another NewOrderMessage#2
- Barista is now simultaneously processing NewOrderMessage#1 and NewOrderMessage#2
- Barista completes processing NewOrderMessage#1 and publishes DrinkReadyMessage#1
- Customer does not Receive DrinkReadyMessage#1
- Barista completes processing NewOrderMessage#2 and publishes DrinkReadyMessage#2
- Customer processes DrinkReadyMessage#2
When I check the queues in RabbitMQ, the starbucks_customer_error queue has the missing DrinkReadyMessage#1. I believe this is because the unsubscribeToken issued prior to publishing NewOrderMessage#1 was called during the second order effectively cancelling the subscription for the first order.In trying to fix this, I setup a Dictionary<Guid, UnsubscribeAction> using the CorrelationId as the key and then invoke the token after the DrinkReadyMessage is received. Doing this allows DrinkReadyMessage#1 through but now DrinkReadyMessage#2 is published by the Barista but is never received by the Customer and doesn't appear in any queues, error or otherwise. ( https://gist.github.com/Hellfire/5405606 )In effect, I've made the problem worse than before.Help!--NOTE: I am using RabbitMQ 3.0.4, Erlang R16B and MassTransit from https://github.com/MassTransit/MassTransit
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-dis...@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/msg/masstransit-discuss/-/SA3DBubKF8AJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
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-dis...@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/msg/masstransit-discuss/-/9EMT34k9a3cJ.
--
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-dis...@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/msg/masstransit-discuss/-/NLE48Sa9tVsJ.
--
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-dis...@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/msg/masstransit-discuss/-/KGQ2m4RS7mYJ.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
That seems overly wasteful. The break out of the consumer should be enough - why it isn't working I don't know.
On Mon, Apr 29, 2013 at 11:58 AM, Dru Sellers <d...@drusellers.com> wrote:
Each customer needs its own IServiceBus and Endpoint AddressQ: is each customer in its own process?
On Mon, Apr 29, 2013 at 1:54 PM, Doug Wilson <doug.k...@gmail.com> wrote:
I hate to beg but I really need help with this. At least tell me if I am barking up the wrong tree... Am I seeing problems where there are none?We're just getting started with messaging and I really want to be able to use MassTransit but if I can't solve something trivial in sample code like this then I worry that we're going to run into much bigger problems with MT down the road.
--
On Wednesday, April 24, 2013 11:00:33 AM UTC-7, Doug Wilson wrote:Does each Customer need it's own instance of IServiceBus or should IServiceBus be a Singleton?On Monday, April 22, 2013 11:37:03 AM UTC-7, Doug Wilson wrote:Thanks Chris,That was what I tried first: https://gist.github.com/Hellfire/5405606So what ends up happening with that is that the first order completes fully with the Customer instance receiving the DrinkReadyMessage. However, the 2nd order (issued before the first completes) only gets the payment message. The final DrinkReadyMessage is sent by the barista instance but it is never received by the customer instance, and worse, it doesn't show up in an _error queue either.dw
On Saturday, April 20, 2013 6:06:56 PM UTC-7, Chris Patterson wrote:Take a look at how the form implements Consumes<DrinkReadyMessage>.For<string>. That's looking at the property CorrelationId on the form, which is the name of the last submitted drink. You would need to remove from consumer from the form and keep track of multiple consumers for each submitted order, each with their own correlated consumer.On Fri, Apr 19, 2013 at 11:26 AM, Doug Wilson <doug.k...@gmail.com> wrote:
Okay... I'm completely stumped.I've experimented with a number of different ways of managing multiple UnsubscribeActions but in every case it seems that there can only be one "active" UnsubscribeAction per IServiceBus instance. If a new one is generated before the previous one has been invoked then any messages generated for the original correlationId end up in an _error queue or disappear entirely.I'm certain I am just misunderstanding how this all works but shouldn't MT keep track of the tokens and honor them until they've been invoked?-dw
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 view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/KGQ2m4RS7mYJ.
--
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-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/_T1eKinlFUkJ.