Parallel Processing
There are different ways in which we can achieve this, but my personal favorite is using some kind of external Queuing Mechanism, which will help us do the processing at all the Server node levels within a Cluster (We should have a Cluster setup, and in Enterprise world that would always be the case).
Although Mule has its own VM Queue, it’s in Memory, and could be used for say Reliability Pattern or Inter Flow Communication, basically we need to make sure that there is not huge data we are trying to store in VM Queues, and if we are really want to do parallel processing for Heavy Objects and just for the topping it takes time for processing (This comes with the flavor of our Architecture as we need to make sure that our system when doing Parallel Processing is Fault Tolerant and we cannot lose a single message, means we need to release a message from Queue only when we want to – Will talk about the entire Design of Highly Scalable System in another post).
Here, we will be writing only about the setup of RabbitMQ and how to use it in Mule.
Rabbit MQ – SSL Connectivity with Mule.
- First we need to have a Rabbit MQ Server with SSL and TLS enabled.
- Follow this site from rabbit mq to set up the server accordingly.
Refrence : https://www.rabbitmq.com/ssl.html
Nice Article depicting the same : http://yuanmengblog.blogspot.com/2015/08/use-mule-amqps-ssl-to-connect-to.html
- Once the Certs are installed on Rabbit MQ Server, we will have to tell Rabbit MQ, use this SSL and allow connectivity only if Request is coming with a valid .jks and .p12 file.
- We can enable this by going to /etc/rabbitmq/conf
Enable below option, ssl_options.fail_if_no_peer_cert = true
Complete Configuration, related to SSL.
## TLS configuration.
##
## Related doc guide: http://rabbitmq.com/ssl.html.
##
ssl_options.cacertfile = /etc/rabbitmq/testca/cacert.pem
ssl_options.certfile = /etc/rabbitmq/server/cert.pem
ssl_options.keyfile = /etc/rabbitmq/server/key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true
ssl_options.versions.1 = tlsv1.2
ssl_options.versions.2 = tlsv1.1
Steps to Set up Mule to Connect to Rabbit MQ with SSL Enabled
- Generate Truststore using .pem file from Server (we will have .pem in client and test ca as well, we need to select server file here).
- Use .p12 file from client, and associated password which should be provided if you were not the one who set up SSL on Rabbit MQ Server, if you yourself did the SSL Set up on Rabbit MQ, you know it .
Example:
<amqps:connector name=”AMQPS_0_9_Connector1″ validateConnections=”true” host=”10.20.30.40″ username=”app_admin” password=”somepassword” doc:name=”AMQPS-0-9 Connector”>
<amqps:ssl-key-store path=”/Users/vashists/Documents/rabbitmq-ssl-ananth/rabbit-ssl-config/client/keycert.p12″ keyPassword=”MySecretPassword” storePassword=”MySecretPassword” type=”pkcs12″ algorithm=”SunX509″/>
<amqps:ssl-trust-store path=”/Users/vashists/Documents/rabbitmq-ssl-ananth/rabbit-ssl-config/trustStore.jks” storePassword=”abc123″ type=”jks” algorithm=”SunX509″/>
</amqps:connector>