Skip to content

Cannot assign ScheduleId in subclass of DefaultRecurringSchedule #6017

@nmummau

Description

@nmummau

Contact Details

No response

Version

8.x

On which operating system(s) are you experiencing the issue?

Windows

Using which broker(s) did you encounter the issue?

RabbitMQ

What are the steps required to reproduce the issue?

I'm working on setting up a recurring schedule using DefaultRecurringSchedule, and I followed the example shown in the MassTransit documentation:

public class PollExternalSystemSchedule : DefaultRecurringSchedule
{
    public PollExternalSystemSchedule()
    {
        ScheduleId = "PollExternalSystem";
        CronExpression = "0 0/1 * 1/1 * ? *";
    }
}

However, this results in a compile-time error:

CS0200: Property or indexer 'DefaultRecurringSchedule.ScheduleId' cannot be assigned to -- it is read only

This happens because ScheduleId appears to be a read-only property or an init-only record property on DefaultRecurringSchedule.

What is the expected behavior?

Update the documentation to clarify that ScheduleId is set automatically based on the type name and cannot be set manually.

Add an example of DefaultRecurringSchedule to the Sample-Quartz

What actually happened?

compile time error

Related log output, including any exceptions

Link to repository that demonstrates/reproduces the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions