Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureServiceBus: add ScheduledEnqueueTimeUtc support #1137

Merged
merged 1 commit into from
May 18, 2022

Conversation

webinex
Copy link
Contributor

@webinex webinex commented May 17, 2022

  • Added support of ScheduledEnqueueTimeUtc for AzureServiceBus transport

Example:

public class DemoController : ControllerBase
{
    private readonly ICapPublisher _publisher;
    private readonly ILogger<DemoController> _logger;

    public DemoController(ICapPublisher publisher, ILogger<DemoController> logger)
    {
        _publisher = publisher;
        _logger = logger;
    }

    [HttpPost("publish")]
    public async Task Publish()
    {
        await _publisher.PublishAsync("demo-publish", string.Empty, new Dictionary<string, string?>
        {
            [AzureServiceBusHeaders.ScheduledEnqueueTimeUtc] = DateTimeOffset.UtcNow.AddSeconds(60).ToString(),
        });
    }

    [CapSubscribe("demo-publish")]
    public Task Subscribe()
    {
        _logger.LogInformation("RECEIVED!!");
        return Task.CompletedTask;
    }
}

Copy link
Member

@yang-xiaodong yang-xiaodong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for your PR!

@yang-xiaodong yang-xiaodong merged commit 1f03afb into dotnetcore:master May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants