Friday, October 14, 2016

RabbitMQ SSL connection Using RabbitMQ Event Adpter in WSO2 CEP- Part 2

stHi all,


This is the continuous blog of this blog. In the previous blog we saw about rabbitMQ broker side configuration. Here we are going to see about specifying CEP side Configuration. RabbitMQ Receiver is an extension for the CEP. So we need to download it and put it into the CEP. Those are given below.

Steps 
  1.  Please visit this link to download RabbitMQ Receiver extension.
  2. Download rabbitmq client jar from this link. 
  3. Place the extension .jar file into the <CEP_HOME>/repository/components/dropins directory which you downloaded in step 1.
  4. Place the rabbitmq client .jar file into the <CEP_HOME>/repository/components/lib directory which you downloaded in step 2.
  5. Start the CEP Server by going to directory <CEP_HOME>/bin in terminal and giving command like sh ./wso2server.sh
  6. Create a Stream in CEP. Refer more here.
  7. Go to Main => Manage => Receiver to open the Available Receivers page and then click Add Event Receiver in the management console. You can get the management console by visiting the https://172.17.0.1:9443/carbon
  8. Select Input Event Adapter Type as rabbitmq.
  9. Then you will get a page like below.


   9. Then you need to specify values for the properties given above. Here I have mentioned important and  mandatory properties' values.

  • Host Name: localhost
  • Host Port: 5671
  • Username: guest
  • Password: guest
  • Queue Name: testsslqueue
  • Exchange Name: testsslexchange
  • SSL Enabled: True
  • SSL Keystore Location: ../client/keycert.p12
  • SSL Keystore Type: PKCS12
  • SSL Keystore Password: MySecretPassword
  • SSL Truststore Location: ../rabbitstore (These are the values we took from the part 1 blog step 5)
  • SSL Truststore Type: JKS
  • SSL Truststore Password: rabbitstore (The password is the one we used when we are key tool command in Step 5)
  • Connection SSL Version: SSL
After specifying above values, select the stream you had add in step 3 and save it. 

Then if there is a message in the queue you mentioned in RabbitMQ broker, you will get it into the CEP. The data from the queue can be used in further in Execution plan for processing and we can publish it.