Re: [masstransit-discuss] SchedulePublish/ScheduleSend in MassTransit-Quartz

675 views
Skip to first unread message

Chris Patterson

unread,
Jan 14, 2013, 1:26:11 PM1/14/13
to masstrans...@googlegroups.com
That is weird, let me look into what you discussed and see what's not lining up properly. Thanks.


On Mon, Jan 14, 2013 at 6:56 AM, Anders Ljusberg <and...@gmail.com> wrote:
Hi,

I've been playing around a little with the fresh bits from MassTransit-Quartz and I'm having a bit of a problem. The only method for scheduling a message that I can find is the Bus.Endpoint.ScheduleSend-method. However, it seems to send the message to the endpoint I'm currently on, not the one where the ScheduleService is listening. If instead I use something like this:

Bus.GetEndpoint(typeof(ScheduleMessage)).ScheduleSend( .. );

The ScheduleService picks it up just fine - but when it is time to send the scheduled message, it sends it to itself (and of course, no-one is listening there..)

I seem to have a work-around that does the trick:

var endpointUri = Bus.GetEndpoint(typeof(TimeoutExpired)).Address.Uri;
var msg = new ScheduleMessageCommand<TimeoutExpired>(_reservationTimeout.FromNow(), endpointUri, new TimeoutExpired() {CorrelationId = CorrelationId});
Bus.Publish(msg);

Where ScheduleMessageCommand is a copy from the one that is found in MassTransit.QuartzIntegration

But I have a weird feeling that this is not the way it was intended to be used... ;-) 

I can see that the README mentions a SchedulePublish method, but I couldn't find anything like that..?

/Anders

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To post to this group, send email to masstrans...@googlegroups.com.
To unsubscribe from this group, send email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/masstransit-discuss/-/vN3qti5ohwEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tim Gebhardt

unread,
Apr 1, 2013, 4:59:51 PM4/1/13
to masstrans...@googlegroups.com
Yep I'll pile on and say I'm having the same problem.  I can't find a SchedulePublish extension method anywhere.  But I think the code you posted is probably what the body of that function should be.

Chris Patterson

unread,
Apr 1, 2013, 5:44:18 PM4/1/13
to masstrans...@googlegroups.com
There is not a SchedulePublish, as that would be significantly more complex and likely result in things happening that you would not expect. The extension methods in the project are completely screwed up at this point, so they'll need to be replaced.

You should run at least one instance of the quartz service on the same rabbitmq endpoint. If you are using MSMQ, well, use a shared queue or put it behind the distributor or you will get duplicates if you use publish.

If you have all of your quartz services running on the same endpoint, using Publish for the ScheduleMessageCommand<> class is fine since only one instance will pick up the command (thank you RabbitMQ).

I'll clean up the extension methods and NuGet references and get another release out soon.




--
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.

Tim Gebhardt

unread,
Apr 2, 2013, 9:18:02 AM4/2/13
to masstrans...@googlegroups.com
Yes we're using RabbitMQ and that's exactly what we're doing: Just having a single instance of the quartzservice running (or perhaps more than one in the future all listening to the same endpoint.

Is this how we're supposed to be scheduling messages to be fired at a future time?  I just want to make sure that I'm not missing something.  Mass Transit's awesome, but I have burned a few days trying to get this one aspect working and I just want to make sure I'm not missing something.

Chris Patterson

unread,
Apr 2, 2013, 1:25:56 PM4/2/13
to masstrans...@googlegroups.com
I've rewritten the extension methods to be more correct, those changes were pushed to GitHub last night but no new NuGet package has been built yet.


--
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.

Tim Gebhardt

unread,
Apr 8, 2013, 10:57:45 PM4/8/13
to masstrans...@googlegroups.com
Oh cool, they look exactly what we need for our project.  When do you think a new NuGet package will be available?


--
You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/3EiGfpCM_YY/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to masstransit-dis...@googlegroups.com.

To post to this group, send email to masstrans...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages