8000 Update erlang tutorials for latest API · syk-coder/rabbitmq-tutorials@d701265 · GitHub
[go: up one dir, main page]

Skip to content

Commit d701265

Browse files
author
Emile Joubert
committed
Update erlang tutorials for latest API
1 parent 5ed8ece commit d701265

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

erlang/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ using apt:
1717

1818
You need Erlang Client binaries:
1919

20-
wget http://www.rabbitmq.com/releases/plugins/v2.2.0/rabbit_common-2.2.0.ez
21-
unzip rabbit_common-2.2.0.ez
20+
wget http://www.rabbitmq.com/releases/plugins/v2.5.0/rabbit_common- 8000 2.5.0.ez
21+
unzip rabbit_common-2.5.0.ez
22+
ln -s rabbit_common-2.5.0 rabbit_common
2223

23-
wget http://www.rabbitmq.com/releases/plugins/v2.2.0/amqp_client-2.2.0.ez
24-
unzip amqp_client-2.2.0.ez
24+
wget http://www.rabbitmq.com/releases/plugins/v2.5.0/amqp_client-2.5.0.ez
25+
unzip amqp_client-2.5.0.ez
26+
ln -s amqp_client-2.5.0 amqp_client
2527

2628

2729
## Code
@@ -38,5 +40,5 @@ You need Erlang Client binaries:
3840

3941
[Tutorial three: Publish/Subscribe](http://www.rabbitmq.com/tutorial-three-python.html):
4042

41-
./emit_log.erl "info: This is the log message"
4243
./receive_logs.erl
44+
./emit_log.erl "info: This is the log message"

erlang/emit_log.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(Argv) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'exchange.declare'{exchange = <<"logs">>,

erlang/new_task.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(Argv) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'queue.declare'{queue = <<"task_queue">>,

erlang/receive.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(_) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'queue.declare'{queue = <<"hello">>}),

erlang/receive_logs.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(_) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'exchange.declare'{exchange = <<"logs">>,

erlang/send.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(_) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'queue.declare'{queue = <<"hello">>}),

erlang/worker.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
-include_lib("amqp_client/include/amqp_client.hrl").
55

66
main(_) ->
7-
{ok, Connection} = amqp_connection:start(network,
8-
#amqp_params{host = "localhost"}),
7+
{ok, Connection} =
8+
amqp_connection:start(#amqp_params_network{host = "localhost"}),
99
{ok, Channel} = amqp_connection:open_channel(Connection),
1010

1111
amqp_channel:call(Channel, #'queue.declare'{queue = <<"task_queue">>,

java/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ To successfully use the examples you will need a running RabbitMQ server.
77

88
## Requirements
99

10-
You'll need to download the RabbitMQ
10+
You'll need to download the RabbitMQ
1111
[java client library package](http://www.rabbitmq.com/java-client.html),
12-
and check its signature as described there.
13-
Unzip it into your working directory and ensure the JAR files from the
12+
and check its signature as described there.
13+
Unzip it into your working directory and ensure the JAR files from the
1414
unzipped directory are placed in your working directory:
1515

1616
$ unzip rabbitmq-java-client-bin-*.zip
1717
$ cp rabbitmq-java-client-bin-*/*.jar ./
1818

1919
To compile you only need the Rabbitmq java client jar on the classpath.
2020

21-
To run them you'll need all the dependencies, see examples below.
21+
To run them you'll need all the dependencies, see examples below.
2222

23-
Note: If you're on Windows,
23+
Note: If you're on Windows,
2424
use a semicolon instead of a colon to separate items in the classpath.
2525

2626
> 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.
5252
[Tutorial three: Publish/Subscribe](http://www.rabbitmq.com/tutorial-three-java.html)
5353

5454
$ javac -cp rabbitmq-client.jar EmitLog.java ReceiveLogs.java
55-
56-
$ java -cp $CP EmitLog
55+
5756
$ java -cp $CP ReceiveLogs
57+
$ java -cp $CP EmitLog
5858

5959

0 commit comments

Comments
 (0)
0