Skip to content

Commit ddb39a3

Browse files
3.0.0 (#1)
* build: 3.0.0
1 parent 3f293fb commit ddb39a3

File tree

11 files changed

+397
-202
lines changed

11 files changed

+397
-202
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
api
33
node_modules
44
samples
5-
*.md
6-
*.json
75
.DS_Store
86
LICENSE

.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"env": {
3-
"browser": true,
43
"node": true
54
},
65
"extends": ["plugin:prettier/recommended"],
@@ -9,7 +8,7 @@
98
"global": true
109
},
1110
"parserOptions": {
12-
"ecmaVersion": 2018,
11+
"ecmaVersion": 2021,
1312
"sourceType": "module",
1413
"ecmaFeatures": {
1514
"jsx": true

.prettierignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ node_modules
77
LICENSE
88
*.png
99
*.txt
10-
TODO
11-
docs/functions.md
12-
*.md
13-
test.log
10+
TODO

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Runnerty Tech S.L.
3+
Copyright (c) 2021 Runnerty Tech S.L.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@
77

88
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency Status][david-badge]][david-badge-url]
99
<a href="#badge">
10-
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
10+
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
1111
</a>
1212

1313
# Executor for [Runnerty]: AMQP
14+
1415
Module AMQP (Advanced Message Queuing Protocol) 0-9-1 Publisher.
1516
This is a wrapper from the [amqplib](https://github.com/squaremo/amqp.node)
1617

1718
### Installation:
19+
1820
```bash
1921
npm i @runnerty/executor-amqp
2022
```
2123

2224
### Configuration:
25+
2326
Add in [config.json]:
27+
2428
##### Simple:
29+
2530
```json
2631
{
2732
"id": "amqp_default",
@@ -31,6 +36,7 @@ Add in [config.json]:
3136
```
3237

3338
##### All parameters:
39+
3440
```json
3541
{
3642
"id": "amqp_default",
@@ -44,7 +50,7 @@ Add in [config.json]:
4450
"frameMax": 1000,
4551
"heartbeat": 0,
4652
"vhost": "/",
47-
"options":{
53+
"options": {
4854
"expiration": 10000,
4955
"userId": "myUserId",
5056
"CC": "myCC",
@@ -54,7 +60,7 @@ Add in [config.json]:
5460
"deliveryMode": true,
5561
"contentType": "myContentType",
5662
"contentEncoding": "myContentEncoding",
57-
"headers": {"header":"value"},
63+
"headers": { "header": "value" },
5864
"priority": 9,
5965
"correlationId": "myCorrelationId",
6066
"replyTo": "myReplyTo",
@@ -67,73 +73,83 @@ Add in [config.json]:
6773
```
6874

6975
### Plan sample:
76+
7077
Add in [plan.json]:
78+
7179
##### Exange:
80+
7281
```json
7382
{
7483
"id": "amqp_default",
7584
"exange": "MY_EXANGE",
7685
"exangeType": "direct",
7786
"routingKey": "runnerty.test.#",
7887
"message": "My message from Runnerty!",
79-
"options":{
88+
"options": {
8089
"persistent": true
8190
}
8291
}
8392
```
93+
8494
##### Or direct to Queue:
95+
8596
```json
8697
{
8798
"id": "amqp_default",
8899
"queue": "MY_QUEUE",
89100
"message": "My message from Runnerty!",
90-
"options":{
101+
"options": {
91102
"priority": 10
92103
}
93104
}
94105
```
106+
95107
### Connection parameters
96-
| Option | Type | Description |
97-
| :-------------- | :------------- | :----------------------------------------------------------------------- |
98-
| protocol | string | The to be used protocol: "amqp" or "amqps". Default value: 'amqp'. |
99-
| hostname | string | Hostname. Default value: 'localhost' |
100-
| port | string | Port. Default value: 5672 |
101-
| username | string | Username. Default value: 'guest' |
102-
| password | string | Password. Default value: 'guest' |
103-
| locale | string | Password. Default value: 'en_US' |
104-
| frameMax | number | The size in bytes of the maximum frame allowed. Default value: 0x1000 |
105-
| heartbeat | number | The period of the connection heartbeat in seconds. Default value: 0 |
106-
| vhost | string | What VHost shall be used. Default value: '/' |
108+
109+
| Option | Type | Description |
110+
| :-------- | :----- | :-------------------------------------------------------------------- |
111+
| protocol | string | The to be used protocol: "amqp" or "amqps". Default value: 'amqp'. |
112+
| hostname | string | Hostname. Default value: 'localhost' |
113+
| port | string | Port. Default value: 5672 |
114+
| username | string | Username. Default value: 'guest' |
115+
| password | string | Password. Default value: 'guest' |
116+
| locale | string | Password. Default value: 'en_US' |
117+
| frameMax | number | The size in bytes of the maximum frame allowed. Default value: 0x1000 |
118+
| heartbeat | number | The period of the connection heartbeat in seconds. Default value: 0 |
119+
| vhost | string | What VHost shall be used. Default value: '/' |
107120

108121
### Message options
122+
109123
##### Can be set in `config` as default or in the process. The value indicated in the process overwrites the one indicated in `config`.
110-
| Option | Type |
111-
| :-------------- | :------------------- |
112-
| expiration | string/number |
113-
| userId | string |
114-
| CC | string/string[] |
115-
| BCC | string/string[] |
116-
| mandatory | boolean |
117-
| persistent | boolean |
118-
| deliveryMode | boolean/number |
119-
| contentType | string |
120-
| contentEncoding | string |
121-
| headers | object (key:value) |
122-
| priority | number |
123-
| correlationId | string |
124-
| replyTo | string |
125-
| messageId | string |
126-
| timestamp | number |
127-
| type | string |
128-
| appId | string |
124+
125+
| Option | Type |
126+
| :-------------- | :----------------- |
127+
| expiration | string/number |
128+
| userId | string |
129+
| CC | string/string[] |
130+
| BCC | string/string[] |
131+
| mandatory | boolean |
132+
| persistent | boolean |
133+
| deliveryMode | boolean/number |
134+
| contentType | string |
135+
| contentEncoding | string |
136+
| headers | object (key:value) |
137+
| priority | number |
138+
| correlationId | string |
139+
| replyTo | string |
140+
| messageId | string |
141+
| timestamp | number |
142+
| type | string |
143+
| appId | string |
129144

130145
More information in amqp-lib [api reference](http://squaremo.github.com/amqp.node/channel_api.html)
131146

132147
### Output (Process values):
133-
* `PROCESS_EXEC_MSG_OUTPUT`: Log operations message.
134-
* `PROCESS_EXEC_ERR_OUTPUT`: Error output message.
135148

136-
[Runnerty]: http://www.runnerty.io
149+
- `PROCESS_EXEC_MSG_OUTPUT`: Log operations message.
150+
- `PROCESS_EXEC_ERR_OUTPUT`: Error output message.
151+
152+
[runnerty]: http://www.runnerty.io
137153
[downloads-image]: https://img.shields.io/npm/dm/@runnerty/executor-amqp.svg
138154
[npm-url]: https://www.npmjs.com/package/@runnerty/executor-amqp
139155
[npm-image]: https://img.shields.io/npm/v/@runnerty/executor-amqp.svg

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const amqp = require('amqplib');
33

4-
const Execution = global.ExecutionClass;
4+
const Executor = require('@runnerty/module-core').Executor;
55

66
class amqpExecutor extends Execution {
77
constructor(process) {

0 commit comments

Comments
 (0)