Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Foundatio.Redis/Queues/RedisQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
{
Properties = options.Properties,
CorrelationId = options.CorrelationId,
GroupId = options.GroupId,

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 221 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)
Comment thread
niemyjski marked this conversation as resolved.
Resolved
Value = data
};
bool success = await _resiliencePolicy.ExecuteAsync(async _ => await _cache.AddAsync(GetPayloadKey(id), envelope, _payloadTimeToLive)).AnyContext();
Expand All @@ -240,7 +241,7 @@
}

Interlocked.Increment(ref _enqueuedCount);
var entry = new QueueEntry<T>(id, options.CorrelationId, data, this, now, 0);
var entry = new QueueEntry<T>(id, options.CorrelationId, data, this, now, 0) { GroupId = options.GroupId };

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntryOptions' does not contain a definition for 'GroupId' and no accessible extension method 'GroupId' accepting a first argument of type 'QueueEntryOptions' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 244 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'
await OnEnqueuedAsync(entry).AnyContext();

_logger.LogTrace("Enqueue done");
Expand Down Expand Up @@ -406,7 +407,7 @@
var attemptsValue = _resiliencePolicy.ExecuteAsync(async _ => await _cache.GetAsync(GetAttemptsKey(workId), 0)).AsTask();
await Task.WhenAll(enqueuedTimeTicks, attemptsValue).AnyContext();

var queueEntry = new QueueEntry<T>(workId, payload.Value.CorrelationId, payload.Value.Value, this, new DateTime(enqueuedTimeTicks.Result, DateTimeKind.Utc), attemptsValue.Result + 1);
var queueEntry = new QueueEntry<T>(workId, payload.Value.CorrelationId, payload.Value.Value, this, new DateTime(enqueuedTimeTicks.Result, DateTimeKind.Utc), attemptsValue.Result + 1) { GroupId = payload.Value.GroupId };

Check failure on line 410 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 410 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 410 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

Check failure on line 410 in src/Foundatio.Redis/Queues/RedisQueue.cs

View workflow job for this annotation

GitHub Actions / build / build

'QueueEntry<T>' does not contain a definition for 'GroupId'

if (payload.Value.Properties != null)
{
Expand Down Expand Up @@ -894,6 +895,7 @@
public record RedisPayloadEnvelope<T>
{
public string? CorrelationId { get; init; }
public string? GroupId { get; init; }
public IDictionary<string, string>? Properties { get; init; }
public required T Value { get; init; }
}
12 changes: 12 additions & 0 deletions tests/Foundatio.Redis.Tests/Queues/RedisQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public override Task DequeueAsync_AfterAbandonWithMutatedValue_ReturnsOriginalVa
return base.DequeueAsync_AfterAbandonWithMutatedValue_ReturnsOriginalValueAsync();
}

[Fact]
public override Task AbandonAsync_WithGroupId_PreservesGroupIdOnRetryAsync()
{
return base.AbandonAsync_WithGroupId_PreservesGroupIdOnRetryAsync();
}

[Fact]
public override Task DequeueAsync_WithDispose_AutoAbandonsEntryAsync()
{
Expand Down Expand Up @@ -162,6 +168,12 @@ public override Task DuplicateDetection_WithNullIdentifier_AcceptsAllItemsAsync(
return base.DuplicateDetection_WithNullIdentifier_AcceptsAllItemsAsync();
}

[Fact]
public override Task EnqueueAsync_WithGroupId_RoundTripsGroupIdAsync()
{
return base.EnqueueAsync_WithGroupId_RoundTripsGroupIdAsync();
}

[Fact]
public override Task EnqueueAsync_WithSerializationError_ThrowsAndLeavesQueueEmptyAsync()
{
Expand Down
Loading