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.
- Please visit this link to download RabbitMQ Receiver extension.
- Download rabbitmq client jar from this link.
- Place the extension .jar file into the
<CEP_HOME>/repository/components/dropinsdirectory which you downloaded in step 1.
- Place the rabbitmq client .jar file into the
<CEP_HOME>/repository/components/libdirectory which you downloaded in step 2.
- Start the CEP Server by going to directory <CEP_HOME>/bin in terminal and giving command like sh ./wso2server.sh
- Create a Stream in CEP. Refer more here.
- 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
- Select Input Event Adapter Type as rabbitmq.
- 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.