Wcf Rabbitmq Binding

WCF RabbitMQ binding

Hello everybody,

recently I've spent plenty of time with the following task: Create Publisher/Subscriber application that via WCF send/receive messages from RabbitMQ. As foundation for my code I've used code from Dieg web site, just modified binding.

Bindings were modified in App.config files. 

Below goes bindings declarations:

 <system.serviceModel>
    <extensions>
      <bindingExtensions>
        <add name="rabbitMQBinding"
             type="RabbitMQ.ServiceModel.RabbitMQBindingSection, RabbitMQ.ServiceModel, Version=3.5.7.0, Culture=neutral,PublicKeyToken=null"/>
      </bindingExtensions>
    </extensions>
    <client>
      <endpoint address="soap.amq:///myqueue"
          binding="rabbitMQBinding"
          bindingConfiguration="rabbitMQConfig"
          contract="testFancyProxyContracts.ISampleContract"
          name="AMQPCalculatorService" />
    </client>
    <bindings>
      <rabbitMQBinding>
        <binding name="rabbitMQConfig"
          hostname="rabbit.test"   
          port="5672"
          username="guest"
          password="guest"
          virtualHost="/"
          oneWay="true"
          maxmessagesize="8192" />
      </rabbitMQBinding>
    </bindings>
  </system.serviceModel>

And if you need to see full source code, you can Download  it. 

No Comments

Add a Comment
Comments are closed