Browse files

Update erlang tutorials for latest API

  • Loading branch information...
1 parent 5ed8ece commit d70126577390439b654642e2b6760f2ed62070bf @emile emile committed Jun 27, 2011
Showing with 26 additions and 24 deletions.
  1. +7 −5 erlang/README.md
  2. +2 −2 erlang/emit_log.erl
  3. +2 −2 erlang/new_task.erl
  4. +2 −2 erlang/receive.erl
  5. +2 −2 erlang/receive_logs.erl
  6. +2 −2 erlang/send.erl
  7. +2 −2 erlang/worker.erl
  8. +7 −7 java/README.md
View
12 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"
View
4 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">>,
View
4 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">>,
View
4 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">>}),
View
4 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">>,
View
4 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">>}),
View
4 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">>,
View
14 java/README.md
@@ -7,20 +7,20 @@ 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
$ cp rabbitmq-java-client-bin-*/*.jar ./
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

0 comments on commit d701265

Please sign in to comment.