#Mule Spike
To run this example, you have to first setup the following:
- Mongo
- RabbitMQ
- Mule (stand-alone version)
- node.js
Start up Mongo.
sudo mongod
Start up RabbitMQ sudo rabbitmq-server
Start the stand-alone version of mule.
sudo ./mule start
If you want to see the log, you may want to go to the log directory and tail the mule-spike.log.
tail -f mule-spike.log
##Initialize the RabbigMQ Next let's setup the user and exchange for RabbitMQ. In the development directory run the init script.
./init-script.sh
In the muleecho directory, start node.
npm install
node amqp.js
In the muleecho directory, run the maven build.
mvn install
Copy the maven built artifact into your mule application directory.
cp target/spike.zip $MULE_INSTALL/apps/
There are three ways the application can be 'ticled'.
-
It will be tickled every 60 seconds (see the polling flow in mule).
-
By 'hitting' the listening mule
curl --data '{"id": "foo", "data": {"rss": "whatever", "other": "other"}}' http://localhost:8090/message
-
By hitting the listening node application
curl --data '{"id": "foo", "data": {"rss": "whatever", "other": "other"}}' http://localhost:3000/push