Zulfiqar's weblog

Middleware, security & random .Net

Archive for July, 2012

Service Bus Property Promotion Nuget Package

Posted by zamd on July 18, 2012

I have just published a Nuget package which adds property promotion features to Service Bus WCF programing model.

image

Once you added the package to your project you can use the PromotedProperty attribute to mark your properties as promoted. The package supports promotion from both complex & primitive arguments. In addition to PromotedPropertyAttribute you also need to stick PropertyPromotionBehavior on each method of your service contract.

Following service contract captures the sample usage.

  1. public class Order
  2. {
  3.     public double Amount { get; set; }
  4.     [PromotedProperty]
  5.     public string ShipCity { get; set; }
  6. }
  7.  
  8. [ServiceContract]
  9. public interface IOrderService
  10. {
  11.     [OperationContract(Name = "SubmitFlat", IsOneWay = true)]
  12.     [PropertyPromotionBehavior]
  13.     void Submit(double amount, [PromotedProperty] string shipCity);
  14.  
  15.     [OperationContract(IsOneWay = true)]
  16.     [PropertyPromotionBehavior]
  17.     void Submit(Order order);
  18. }

Enjoy…

Posted in Uncategorized | Leave a Comment »

Service Bus Server Install Experience

Posted by zamd on July 17, 2012

Today I installed Service Bus Server Beta release and the overall install experience was fairly smooth until I reached the New-SBFarm step of the ‘Getting started’ tutorial. The cmdlet just seems to hang for few minutes and failed ultimately – I tried on another machine & got same results. After lot of head–scratching I narrowed down the issue to SQL connectivity. Turns out New-SBFarm create 3 different databases, Farm management DB, Gateway DB & the message container database. The first two DBs are created by the cmdlet itself & it uses the Connection String passed into the cmdlet and just replaces the DB name. The message container DB creation is handled by another cmdlet ‘New-SBMessageContainer’ which uses the FQDN of the database server.

When server is identified using FQDN, SQL client code treats the connection as ‘Remote’ and because I was using a named instance – it tries to resolve the name using SQL Browser service which was by default disabled :(

Hence the cmdlet hanged until connection request timeout – Enabling remote connections on Sql express & starting the SQL Browser service has fixed the issue.

Posted in Uncategorized | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.