Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using IntegrationTests;
using JasperFx.Core;
using Shouldly;
using Wolverine.ComplianceTests.Compliance;
using Wolverine.Configuration;
using Wolverine.Postgresql;
using Wolverine.RabbitMQ.Internal;
using Wolverine.Tracking;
using Xunit;

namespace Wolverine.RabbitMQ.Tests;


public class ProcessInlineFixture : TransportComplianceFixture, IAsyncLifetime
{
public ProcessInlineFixture() : base($"rabbitmq://queue/inline1".ToUri())
{
}

public async Task InitializeAsync()
{
OutboundAddress = $"rabbitmq://queue/inline1".ToUri();

await SenderIs(opts =>
{
var listener = $"listener{RabbitTesting.Number}";

opts.Durability.Mode = DurabilityMode.Solo;

opts.UseRabbitMq()
.AutoProvision()
.AutoPurgeOnStartup()
.DisableDeadLetterQueueing()
.DeclareQueue("quorum1").ConfigureListeners(l => l.ProcessInline());

opts.PersistMessagesWithPostgresql(Servers.PostgresConnectionString, "inline_sender");

opts.ListenToRabbitQueue("inline2").TelemetryEnabled(false);
});

await ReceiverIs(opts =>
{
opts.Durability.Mode = DurabilityMode.Solo;

opts.UseRabbitMq()
.DisableDeadLetterQueueing()
.ConfigureListeners(l => l.ProcessInline());

opts.PersistMessagesWithPostgresql(Servers.PostgresConnectionString, "inline_receiver");

opts.ListenToRabbitQueue("inline1").TelemetryEnabled(false);
});
}

public async Task DisposeAsync()
{
await DisposeAsync();
}
}

public class process_inline_compliance : TransportCompliance<ProcessInlineFixture>
{

}
5 changes: 4 additions & 1 deletion src/Wolverine/Runtime/MessageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public async Task MoveToDeadLetterQueueAsync(Exception exception)
throw new InvalidOperationException("No Envelope is active for this context");
}

if (_channel is ISupportDeadLetterQueue c && c.NativeDeadLetterQueueEnabled)
if (_channel is ISupportDeadLetterQueue { NativeDeadLetterQueueEnabled: true } c)
{
if (Envelope.Batch != null)
{
Expand Down Expand Up @@ -182,6 +182,9 @@ public async Task MoveToDeadLetterQueueAsync(Exception exception)
// If persistable, persist
await Storage.Inbox.MoveToDeadLetterStorageAsync(Envelope, exception);
}

// If this is Inline
await _channel.CompleteAsync(Envelope);
}

public Task RetryExecutionNowAsync()
Expand Down
Loading