Skip to content

Commit

Permalink
bump patch version, minor updates to CI and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Feb 16, 2021
1 parent 9fed71e commit 19b037e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 40 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Expand Up @@ -9,11 +9,7 @@ dist: xenial

julia:
- 1.0
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5
- 1
- nightly

addons:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -3,7 +3,7 @@ uuid = "79c8b4cd-a41a-55fa-907c-fab5288e1383"
keywords = ["amqpclient", "rabbitmq", "amqp", "amqp-client", "message-queue"]
license = "MIT"
desc = "A Julia AMQP (Advanced Message Queuing Protocol) / RabbitMQ Client."
version = "0.4.0"
version = "0.4.1"

[deps]
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Expand Down
58 changes: 24 additions & 34 deletions QUEUES.md
Expand Up @@ -2,66 +2,56 @@

Constants representing the standard exchange types are available as: `EXCHANGE_TYPE_DIRECT`, `EXCHANGE_TYPE_FANOUT`, `EXCHANGE_TYPE_TOPIC`, and `EXCHANGE_TYPE_HEADERS`.

Exchanges can be delcared and deleted using the `exchange_declare` and `exchange_delete` APIs. They return a boolean to indicate success (true) or failure (false).
Exchanges can be delcared and deleted using the `exchange_declare` and `exchange_delete` APIs. They return a boolean to indicate success (`true`) or failure (`false`).
Declaring an already existing exchange simply attaches to it, a new exchange is created otherwise.

````julia
# declare (create if they do not exist) new exchange
EXCG_DIRECT = "MyDirectExcg"
EXCG_FANOUT = "MyFanoutExcg"
success = exchange_declare(chan1, EXCG_DIRECT, EXCHANGE_TYPE_DIRECT)
success || println("error!")
success = exchange_declare(chan1, EXCG_FANOUT, EXCHANGE_TYPE_FANOUT)
success || println("error!")
```julia
# declare (create if they do not exist) new exchange
EXCG_DIRECT = "MyDirectExcg"
EXCG_FANOUT = "MyFanoutExcg"
@assert exchange_declare(chan1, EXCG_DIRECT, EXCHANGE_TYPE_DIRECT)
@assert exchange_declare(chan1, EXCG_FANOUT, EXCHANGE_TYPE_FANOUT)

# operate with the exchanges...
# operate with the exchanges...

# delete exchanges
success = exchange_delete(chan1, EXCG_DIRECT)
success || println("error!")
success = exchange_delete(chan1, EXCG_FANOUT)
success || println("error!")
````
# delete exchanges
@assert exchange_delete(chan1, EXCG_DIRECT)
@assert exchange_delete(chan1, EXCG_FANOUT)
```

Queues can similarly be declared and deleted.
Attaching to an existing queue also returns the number of pending messages and the number of consumers attached to the queue.

````julia
```julia
QUEUE1 = "MyQueue"
success, queue_name, message_count, consumer_count = queue_declare(chan1, QUEUE1)
success || println("error!")
@assert success

# operate with the queue

# delete the queue
success, message_count = queue_delete(chan1, QUEUE1)
success || println("error!")
````
@assert success
```

Messages are routed by binding queues and exchanges to other exchanges. The type of exchange and the routing key configured determine the path.

````julia
```julia
ROUTE1 = "routingkey1"
# bind QUEUE1 to EXCG_DIRECT,
# specifying that only messages with routing key ROUTE1 should be delivered to QUEUE1
success = queue_bind(chan1, QUEUE1, EXCG_DIRECT, ROUTE1)
success || println("error!")
@assert queue_bind(chan1, QUEUE1, EXCG_DIRECT, ROUTE1)

# operate with the queue

# remove the binding
success = queue_unbind(chan1, QUEUE1, EXCG_DIRECT, ROUTE1)
success || println("error!")
````
@assert queue_unbind(chan1, QUEUE1, EXCG_DIRECT, ROUTE1)
```

Messages on a queue can be purged:

````julia
```julia
success, message_count = queue_purge(chan1, QUEUE1)
if success
println("$message_count messages were purged")
else
println("error!")
end
````

@assert success
@info("messages purged", message_count)
```
1 change: 1 addition & 0 deletions appveyor.yml
@@ -1,5 +1,6 @@
environment:
matrix:
- julia_version: 1.0
- julia_version: 1
- julia_version: nightly

Expand Down

0 comments on commit 19b037e

Please sign in to comment.