Friday, September 4, 2015

Configuring RabbitMQ With WSO2 ESB 4.8.1 PART 1

Environment

  • WSO2 ESB 4.8.1
  • RabbitMQ 3.5.4
  • Erlang OTP 18.0
  • JDK 1.7

In this blog post I'm going to explain Integrating RabbitMQ with WSO2 ESB 4.8.1 for Message provider and consumer operations. 

ESB can act as message provider to the queue and consumer from the queue. Following diagram shows provider and consumer operations


Diagram 1: ESB Producer/Consumer Operations

Installing RabbitMQ 


RabbitMQ uses Erlang OTP so it is must  install Erlang before installing the RabbitMQ.

In Windows

  1. Download Erlang OTP  from here. Installing process is automated. Double click the .exe file and follow the default instructions.
  2. Download RabbitMQ installer from here and install it with default settings. After finishing the server will automatically up and run.

In Linux

  1. Install Erlang by using the following command. sudo apt-get install erlang erlang-doc
  2. Download RabbitMQ Generic Unix release (tar.gz, from rabbitmq.com)  from here

Enabling the RabbitMQ management plugin


By default management GUI is disable so we have to manually enable it. Go inside the sbin folder using terminal and run the command ./rabbitmq-plugins enable rabbitmq_management


You will see following plugins enable after you run the above command
  • mochiweb
  • webmachine
  • rabbitmq-web-dispatch
  • amqp_client
  • rabbitmq-management-agent
  • rabbitmq-management
So now we have successfully enable the management console plugin.

To start the server, please use the command. ./rabbitmq-server start within the sbin directory and now we can access the console using the URL http://localhost:15672/ (If you want to access the console remotely replace the localhost with the IP address)


Login to the management console using following user Name and Password.
User Name - guest
Password - guest

So you can see the RabbitMQ management console like following

Diagram 2: RabbitMQ Management Console


It's better to create new user account for future works. So go to the admin tab and create a new user with Admin tag. Click on the newly created user name and set admin permissions. So now the RabbitMQ Server is up and running. We will see how to configure the WSO2 ESB 4.8.1 to deal with the RabbitMQ. Please follow the second part of this post.



If your server doesn't start please make sure whether following ports are free and any firewall or security application not prevent the RabbitMQ from binding to a port.


  • 4369 (epmd), 25672 (Erlang distribution)
  • 5672, 5671 (AMQP 0-9-1 without and with TLS)
  • 15672 (if management plugin is enabled)
  • 61613, 61614 (if STOMP is enabled)
  • 1883, 8883 (if MQTT is enabled)









No comments :

Post a Comment