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
Expand Up @@ -20,7 +20,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
{
context
.ServiceProvider
.GetRequiredService<RabbitMqDistributedEventBus>()
.GetRequiredService<IRabbitMqDistributedEventBus>()
.Initialize();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Volo.Abp.EventBus.Distributed;

namespace Volo.Abp.EventBus.RabbitMq;

public interface IRabbitMqDistributedEventBus : IDistributedEventBus
{
void Initialize();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace Volo.Abp.EventBus.RabbitMq;
/* TODO: How to handle unsubscribe to unbind on RabbitMq (may not be possible for)
*/
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IDistributedEventBus), typeof(RabbitMqDistributedEventBus))]
public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDependency
[ExposeServices(typeof(IDistributedEventBus), typeof(RabbitMqDistributedEventBus), typeof(IRabbitMqDistributedEventBus))]
public class RabbitMqDistributedEventBus : DistributedEventBusBase, IRabbitMqDistributedEventBus, ISingletonDependency
{
protected AbpRabbitMqEventBusOptions AbpRabbitMqEventBusOptions { get; }
protected IConnectionPool ConnectionPool { get; }
Expand Down Expand Up @@ -72,7 +72,7 @@ public RabbitMqDistributedEventBus(
EventTypes = new ConcurrentDictionary<string, Type>();
}

public void Initialize()
public virtual void Initialize()
{
Consumer = MessageConsumerFactory.Create(
new ExchangeDeclareConfiguration(
Expand Down Expand Up @@ -290,7 +290,7 @@ public virtual Task PublishAsync(
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
var body = Serializer.Serialize(eventData);

return PublishAsync( eventName, body, headersArguments, eventId, correlationId);
return PublishAsync(eventName, body, headersArguments, eventId, correlationId);
}

protected virtual Task PublishAsync(
Expand Down
Loading