After installing Erlang, save the following code in a file named 'math1.erl':
-module(math1). -export([factorial/1]). factorial(0) -> 1; factorial(N) -> N * factorial(N-1).
[greg:erlang] erl 1> c(math1.erl). {ok,math1} 2> math1:factorial(25). 15511210043330985984000000 3>
Setup RabbitMQ
Once Erlang works, you can run RabbitMQ. After downloading and extracting the archive, I created 'log', 'mnesia' and 'config' folders in my rabbitmq_server folder and then set these environment variables.export RABBIT=/bin/rabbitmq_server-1.8.1 export RABBITMQ_MNESIA_BASE=$RABBIT/mnesia export RABBITMQ_LOG_BASE=$RABBIT/log export RABBITMQ_NODENAME=gregs export RABBITMQ_NODE_IP_ADDRESS=0.0.0.0 export RABBITMQ_NODE_PORT=5672 export RABBITMQ_CLUSTER_CONFIG_FILE=$RABBIT/config/rabbitmq_cluster.config export RABBITMQ_CONFIG_FILE=$RABBIT/config/rabbitmq
Run RabbitMQ
[greg:rabbitmq_server-1.8.1] ./sbin/rabbitmq-server
Client Code
Examples of Groovy clients using the RabbitMQ server are shown here.Java client code is explained here.
Running the Included LoanBroker Example
[greg:~] cd spring-integration-2.0.0.M6/samples/loanbroker [greg:loan-broker] mvn compile [greg:loan-broker] mvn test . . . INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - ********* Best Quote: ====== Loan Quote ===== Lender: StubBank-13 Loan amount: $253,664 Quote Date: Wed Aug 18 08:44:37 CDT 2010 Expiration Date: Sat Sep 11 08:44:37 CDT 2010 Term: 19 years Rate: 5.130192% ======================= INFO : org.springframework.integration.samples.loanbroker.stubs.CreditBureauStub - Credit Score: 797 INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - ********* All Quotes: INFO : org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo - ====== Loan Quote ===== Lender: StubBank-0 Loan amount: $272,807 Quote Date: Wed Aug 18 08:44:37 CDT 2010 Expiration Date: Mon Aug 23 08:44:37 CDT 2010 Term: 19 years Rate: 5.1708126% ======================= . . .