You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: readme.md
+17-5
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# adonis-rabbit
2
2
3
-
`rabbitmq-adonis-v6` is a RabbitMQ provider for [Adonis](https://github.com/adonisjs/core).
3
+
`rabbitmq-adonis-v6` is a RabbitMQ provider for [Adonis](https://adonisjs.com/).
4
4
5
5
## Getting Started
6
6
@@ -35,7 +35,7 @@ Make sure to set the correct values to the enviroment variables so `rabbitmq-ado
35
35
### Sending messages to an queue
36
36
37
37
```ts
38
-
importRabbitfrom'rabbitmq-adonis-v6'
38
+
import{ Rabbit }from'rabbitmq-adonis-v6'
39
39
importrouterfrom'@adonisjs/core/services/router'
40
40
41
41
Route.get('/', async () => {
@@ -56,7 +56,7 @@ Notice doesn't really makes sense to subscribe to an queue inside a controller,
56
56
Inside `start/rabbit.ts`:
57
57
58
58
```ts
59
-
importRabbitfrom'rabbitmq-adonis-v6'
59
+
import{ Rabbit }from'rabbitmq-adonis-v6'
60
60
61
61
asyncfunction listen() {
62
62
awaitRabbit.assertQueue('my_queue')
@@ -78,7 +78,7 @@ This will log every message sent to my queue `my_queue`.
78
78
#### Import
79
79
80
80
```ts
81
-
importRabbitfrom'rabbitmq-adonis-v6'
81
+
import{ Rabbit }from'rabbitmq-adonis-v6'
82
82
```
83
83
84
84
#### `assertQueue()`
@@ -214,6 +214,14 @@ Retrieves the amqplib's Channel instance. If there's not a connection, it'll be
214
214
awaitRabbit.getChannel()
215
215
```
216
216
217
+
#### `validateConnection()`
218
+
219
+
Indicate if has an active connection
220
+
221
+
```ts
222
+
awaitRabbit.validateConnection()
223
+
```
224
+
217
225
#### `closeChannel()`
218
226
219
227
Closes the channel.
@@ -226,7 +234,7 @@ Closes the connection.
226
234
227
235
### Message
228
236
229
-
When consuming messages through [`consumeFrom`](https://github.com/jotaajunior/adonis-rabbit#consumefrom), you'll receive in the callback a Message instance.
237
+
When consuming messages through [`consumeFrom`](https://github.com/mvargaslandolfi/rabbitmq-adonis-v6#consumefrom), you'll receive in the callback a Message instance.
230
238
231
239
This slightly different from amqplib approach. For example:
232
240
@@ -318,3 +326,7 @@ Parameters:
318
326
In your .env you have to put the service container name, for example:
Part of the code for this package has been taken and adapted from the RabbitMQ package for Adonis v5. You can find the original package [here](https://github.com/jotaajunior/adonis-rabbit).
0 commit comments