Skip to content

Commit

Permalink
Related to MassTransit#4356 - catch/retry exceptions when producing m…
Browse files Browse the repository at this point in the history
…essages on connection failure for ActiveMQ transport
  • Loading branch information
phatboyg committed Jun 6, 2023
1 parent b74ec4e commit 312b8cd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace MassTransit.ActiveMqTransport.Configuration
{
using System;
using System.Threading.Channels;
using Apache.NMS.ActiveMQ;
using MassTransit.Configuration;
using Topology;
using Transports;
Expand All @@ -27,6 +29,8 @@ public ActiveMqHostConfiguration(IActiveMqBusConfiguration busConfiguration, IAc
ReceiveTransportRetryPolicy = Retry.CreatePolicy(x =>
{
x.Handle<ConnectionException>();
x.Handle<IOException>();
x.Handle<ChannelClosedException>();

x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3));
});
Expand Down

0 comments on commit 312b8cd

Please sign in to comment.