From d70126577390439b654642e2b6760f2ed62070bf Mon Sep 17 00:00:00 2001 From: Emile Joubert Date: Mon, 27 Jun 2011 13:14:11 +0100 Subject: [PATCH] Update erlang tutorials for latest API --- erlang/README.md | 12 +++++++----- erlang/emit_log.erl | 4 ++-- erlang/new_task.erl | 4 ++-- erlang/receive.erl | 4 ++-- erlang/receive_logs.erl | 4 ++-- erlang/send.erl | 4 ++-- erlang/worker.erl | 4 ++-- java/README.md | 14 +++++++------- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/erlang/README.md b/erlang/README.md index 1ae297ad..cbbf9d24 100644 --- a/erlang/README.md +++ b/erlang/README.md @@ -17,11 +17,13 @@ using apt: You need Erlang Client binaries: - wget http://www.rabbitmq.com/releases/plugins/v2.2.0/rabbit_common-2.2.0.ez - unzip rabbit_common-2.2.0.ez + wget http://www.rabbitmq.com/releases/plugins/v2.5.0/rabbit_common-2.5.0.ez + unzip rabbit_common-2.5.0.ez + ln -s rabbit_common-2.5.0 rabbit_common - wget http://www.rabbitmq.com/releases/plugins/v2.2.0/amqp_client-2.2.0.ez - unzip amqp_client-2.2.0.ez + wget http://www.rabbitmq.com/releases/plugins/v2.5.0/amqp_client-2.5.0.ez + unzip amqp_client-2.5.0.ez + ln -s amqp_client-2.5.0 amqp_client ## Code @@ -38,5 +40,5 @@ You need Erlang Client binaries: [Tutorial three: Publish/Subscribe](http://www.rabbitmq.com/tutorial-three-python.html): - ./emit_log.erl "info: This is the log message" ./receive_logs.erl + ./emit_log.erl "info: This is the log message" diff --git a/erlang/emit_log.erl b/erlang/emit_log.erl index f782062c..5c593ffb 100755 --- a/erlang/emit_log.erl +++ b/erlang/emit_log.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(Argv) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'exchange.declare'{exchange = <<"logs">>, diff --git a/erlang/new_task.erl b/erlang/new_task.erl index 0ca74c9d..b44afd60 100755 --- a/erlang/new_task.erl +++ b/erlang/new_task.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(Argv) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'queue.declare'{queue = <<"task_queue">>, diff --git a/erlang/receive.erl b/erlang/receive.erl index 9a99e5e8..144c50c0 100755 --- a/erlang/receive.erl +++ b/erlang/receive.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(_) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'queue.declare'{queue = <<"hello">>}), diff --git a/erlang/receive_logs.erl b/erlang/receive_logs.erl index f771af9d..46530535 100755 --- a/erlang/receive_logs.erl +++ b/erlang/receive_logs.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(_) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'exchange.declare'{exchange = <<"logs">>, diff --git a/erlang/send.erl b/erlang/send.erl index ebcd32b7..0733dc37 100755 --- a/erlang/send.erl +++ b/erlang/send.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(_) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'queue.declare'{queue = <<"hello">>}), diff --git a/erlang/worker.erl b/erlang/worker.erl index 067fde42..9ce9dd32 100755 --- a/erlang/worker.erl +++ b/erlang/worker.erl @@ -4,8 +4,8 @@ -include_lib("amqp_client/include/amqp_client.hrl"). main(_) -> - {ok, Connection} = amqp_connection:start(network, - #amqp_params{host = "localhost"}), + {ok, Connection} = + amqp_connection:start(#amqp_params_network{host = "localhost"}), {ok, Channel} = amqp_connection:open_channel(Connection), amqp_channel:call(Channel, #'queue.declare'{queue = <<"task_queue">>, diff --git a/java/README.md b/java/README.md index 32eedf7d..f90ea16f 100644 --- a/java/README.md +++ b/java/README.md @@ -7,10 +7,10 @@ To successfully use the examples you will need a running RabbitMQ server. ## Requirements -You'll need to download the RabbitMQ +You'll need to download the RabbitMQ [java client library package](http://www.rabbitmq.com/java-client.html), -and check its signature as described there. -Unzip it into your working directory and ensure the JAR files from the +and check its signature as described there. +Unzip it into your working directory and ensure the JAR files from the unzipped directory are placed in your working directory: $ unzip rabbitmq-java-client-bin-*.zip @@ -18,9 +18,9 @@ unzipped directory are placed in your working directory: To compile you only need the Rabbitmq java client jar on the classpath. -To run them you'll need all the dependencies, see examples below. +To run them you'll need all the dependencies, see examples below. -Note: If you're on Windows, +Note: If you're on Windows, use a semicolon instead of a colon to separate items in the classpath. > You can set an environment variable for the jar files on the classpath e.g. @@ -52,8 +52,8 @@ use a semicolon instead of a colon to separate items in the classpath. [Tutorial three: Publish/Subscribe](http://www.rabbitmq.com/tutorial-three-java.html) $ javac -cp rabbitmq-client.jar EmitLog.java ReceiveLogs.java - - $ java -cp $CP EmitLog + $ java -cp $CP ReceiveLogs + $ java -cp $CP EmitLog