I am setting up a small application to test a newly created Basic tier Azure service bus. I am using Masstransit to set up a sample publisher:
ServiceBusFactory.New(sbc =>
{
var queueUri = "azure-sb://" + azureNamespace + "/Sample_TestPub";
sbc.UseAzureServiceBus(a =>
{
a.SetDefaultMessageTimeToLive(TimeSpan.FromSeconds(30));
a.ConfigureNamespace(azureNamespace ,
azureNs =>
{
azureNs.SetKey(sharedKey);
azureNs.SetKeyName(keyName);
azureNs.Validate();
});
});
sbc.ReceiveFrom(queueUri);
sbc.UseAzureServiceBusRouting();
})
)
I am using the following code to publish:
text = Console.ReadLine();
var newWhat = new SomethingRequest
{
What = text,
When = DateTime.Now
};
ISomethingResponse response = null;
bus.PublishRequest(newWhat, cfg =>
{
cfg.Handle<ISomethingResponse>(r => response = r);
});
On PublishRequest() I am getting the following error:
azure-sb://namespace/Sample_TestPub => Invalid connection to host
inner exception: {"The remote server returned an error: (400) Bad Request. SubCode=40000. The property value for 'DefaultMessageTimeToLive' must be between 00:00:01 and 14.00:00:00 when the namespace 'namespace' is using 'Basic' tier.\r\nParameter name: DefaultMessageTimeToLive. TrackingId:67c96bcc-e376-429a-8f22-79227e89f935_G24,TimeStamp:2/3/2015 2:56:33 AM"}
I have not configured my bus in anyway through the Azure portal - is there something I am missing? Does the SetDefaultMessageTimeToLive() call not do what I think it does?