Thursday, July 5, 2012

How to run QPid WCF samples

 Recently I had to work in a project where I need to connect to Qpid server using a C# client. Before start the project I wanted to try out some samples in Qpid in order to get familiar with Qpid and WCF binding. There I had to face lot of difficulties since lack of gudelines provided by Qpid. Therefore I thought of writing down step by step guidlines to run Qpid WCF samples.


  • Download QPid from http://qpid.apache.org/download.html.
  • Create an environment variable called QPID_ROOT for qpid base directory.(eg:C:\qpid\qpid-0.16)
  • Installl Visual Studio 2008.
  • Install Microsoft Visual Studio 2008 Service Pack 1
  • Install Boost 1.47.
    •     Go to the boost root directory.
    •     Run bootstrap.bat
    •     Run b2 toolset=msvc --build-type=complete stage -j<# cores>
  • Include the location of the Boost library (e.g. %BOOST_ROOT%\lib) in your PATH environment variable.
  • Create an environment variable called BOOST_ROOT for the root of the boost directory.
  • Install SDK 3.5.
  • Install NUnit.
  • Build Qpid cpp


    •     Build CMake.
    •     Build python
    •     Build Ruby.
    •     Ensure that all the build tools are available on your path(Eg:PATH=C:\python25;)
    •     From a command prompt:
      •     # cd qpid\cpp
      •     # cmake -i -G "Visual Studio 9 2008" 
    •     Go to \qpid-0.16\cpp. Open the qpid-cpp.sln solution, select Debug or Release, and build.

   

  • Create an environmentvariable called QPID_BUILD_ROOT and store the path to the Qpid build directory in it.(Eg:C:\qpid\qpid-0.16\cpp)
  • Open VS 2008 and build(by setting the platform target as x86)

                %QPID_ROOT%\wcf\QpidWcf.sln
                 %QPID_ROOT%\wcf\tools\QCreate\QCreate.sln
   
   
 Building and executing samples
=================================

WCFToWCFDirect

1.Copy the dlls Apache.Qpid.Channel.dll and Apache.Qpid.Interop.dll from %QPID_ROOT%\wcf\src\Apache\Qpid\Channel\bin\x86\Debug
  to the %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect folder.

2.Build the solution WCFToWCFDirect.sln.(by setting the platform target as x86))

3.Copy qpidclientd.dll, qpidcommond.dll and qpidtypesd.dll from %QPID_ROOT%\cpp\src\Debug to bin\x86\Debug of each of the projects.
 These dlls are needed at runtime.

4.Copy qpidclientd.dll, qpidcommond.dll and qpidtypesd.dll to %QPID_ROOT%\wcf\tools\QCreate\Debug folder.

5.Start the qpid broker from the qpid build folder e.g. %QPID_ROOT%\cpp\src\Debug.
        command:qpidd.exe  qpidd.exe --data-dir=<to place where it need to be> --auth no
            (Eg:qpidd.exe --data-dir=C:\qpid\qpid-0.16\cpp\src\Debug auth no)

6.Create queue required using the QCreate tool located at
  %QPID_ROOT%\wcf\tools\QCreate\Debug. The syntax is QCreate %QPID_ROOT%. For
  this sample you should do

      QCreate amq.direct routing_key message_queue
     
7. Start Service.exe from(Open the cmd as administrator)
      %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect\Service\bin\Debug.

8. Start Client.exe from
      %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect\Client\bin\Debug.

       

No comments:

Post a Comment