-
Notifications
You must be signed in to change notification settings - Fork 84
Large Message Support
Azure Service Bus brokered messages have a maximum size of 256KB. This means you shouldn't be able to send or publish messages larger than this.
To work around this, Nimbus has what we call Large Message Storage. If configured, in the event of the message payload being too large, Nimbus will serialize the body of the message to another location and send the message with a pointer to the message body.
Currently we support a shared file system and Azure Blob Storage as message stores.
To configure storage, install the Nimbus.LargeMessages.FileSystem or Nimbus.LargeMessages.Azure packages.
Next step is configuration of the storage.
var largeMessageBodyStorage = new FileSystemStorageBuilder().Configure()
.WithStorageDirectory(largeMessageBodyTempPath)
.WithLogger(c.Resolve<ILogger>())
.Build()
or for Azure
var largeMessageBodyStorage = new BlobStorageBuilder().Configure()
.UsingStorageAccountConnectionString(CommonResources.BlobStorageConnectionString)
.WithLogger(logger)
.Build();
Then as part of your BusBuilder configuration, add this line.
.WithLargeMessageStorage(c => c.WithLargeMessageBodyStore(largeMessageBodyStorage)
.WithMaxSmallMessageSize(64*1024)
.WithMaxLargeMessageSize(10*1048576))
Of course, you can also do this with an IoC container.
builder.Register(c => new FileSystemStorageBuilder().Configure()
.WithStorageDirectory(largeMessageBodyTempPath)
.WithLogger(c.Resolve<ILogger>())
.Build())
.As<ILargeMessageBodyStore>()
.SingleInstance();
and
.WithLargeMessageStorage(sc => sc.WithLargeMessageBodyStore(c.Resolve<ILargeMessageBodyStore>())
.WithMaxSmallMessageSize(50*1024)
.WithMaxLargeMessageSize(1024*1024))
Azure Service Bus
Windows Service Bus
Redis
In Process
Configuring Nimbus With Autofac
Configuring Nimbus With Windsor
Configuring Nimbus With Ninject
Sending a Command on the Bus
Publishing an Event on the Bus
Request Response
Multicast Request Response
Multicast Request Response - take First
Large Message Support