Skip to content

Commit

Permalink
Update erlang tutorials for latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
Emile Joubert committed Jun 27, 2011
1 parent 5ed8ece commit d701265
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
12 changes: 7 additions & 5 deletions erlang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
4 changes: 2 additions & 2 deletions erlang/emit_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>,
Expand Down
4 changes: 2 additions & 2 deletions erlang/new_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>,
Expand Down
4 changes: 2 additions & 2 deletions erlang/receive.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>}),
Expand Down
4 changes: 2 additions & 2 deletions erlang/receive_logs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>,
Expand Down
4 changes: 2 additions & 2 deletions erlang/send.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>}),
Expand Down
4 changes: 2 additions & 2 deletions erlang/worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>,
Expand Down
14 changes: 7 additions & 7 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.