Skip to content

Repository files navigation

Smart Processes Management

NPM versionDownloadsDependency Statuscode style: prettier

Executor for Runnerty: AMQP

Module AMQP (Advanced Message Queuing Protocol) 0-9-1 Publisher. This is a wrapper from the amqplib

Installation:

npm i @runnerty/executor-amqp

Configuration:

Add in config.json:

Simple:
{
"id": "amqp_default",
"type": "@runnerty-executor-amqp",
"hostname": "localhost"
}
All parameters:
{
"id": "amqp_default",
"type": "@runnerty-executor-amqp",
"protocol": "amqp",
"hostname": "localhost",
"port": 5672,
"username": "guest",
"password": "guest",
"locale": "en_US",
"frameMax": 1000,
"heartbeat": 0,
"vhost": "/",
"options": {
"expiration": 10000,
"userId": "myUserId",
"CC": "myCC",
"BCC": ["bcc1,bcc2"],
"mandatory": false,
"persistent": true,
"deliveryMode": true,
"contentType": "myContentType",
"contentEncoding": "myContentEncoding",
"headers": { "header": "value" },
"priority": 9,
"correlationId": "myCorrelationId",
"replyTo": "myReplyTo",
"messageId": "myMessageId",
"timestamp": 999999999,
"type": "myType",
"appId": "myAppId"
}
}

Plan sample:

Add in plan.json:

Exange:
{
"id": "amqp_default",
"exange": "MY_EXANGE",
"exangeType": "direct",
"routingKey": "runnerty.test.#",
"message": "My message from Runnerty!",
"options": {
"persistent": true
}
}
Or direct to Queue:
{
"id": "amqp_default",
"queue": "MY_QUEUE",
"message": "My message from Runnerty!",
"options": {
"priority": 10
}
}

Connection parameters

OptionTypeDescription
protocolstringThe to be used protocol: "amqp" or "amqps". Default value: 'amqp'.
hostnamestringHostname. Default value: 'localhost'
portstringPort. Default value: 5672
usernamestringUsername. Default value: 'guest'
passwordstringPassword. Default value: 'guest'
localestringPassword. Default value: 'en_US'
frameMaxnumberThe size in bytes of the maximum frame allowed. Default value: 0x1000
heartbeatnumberThe period of the connection heartbeat in seconds. Default value: 0
vhoststringWhat VHost shall be used. Default value: '/'

Message options

Can be set in config as default or in the process. The value indicated in the process overwrites the one indicated in config.
OptionType
expirationstring/number
userIdstring
CCstring/string[]
BCCstring/string[]
mandatoryboolean
persistentboolean
deliveryModeboolean/number
contentTypestring
contentEncodingstring
headersobject (key:value)
prioritynumber
correlationIdstring
replyTostring
messageIdstring
timestampnumber
typestring
appIdstring

More information in amqp-lib api reference

Output (Process values):

  • PROCESS_EXEC_MSG_OUTPUT: Log operations message.
  • PROCESS_EXEC_ERR_OUTPUT: Error output message.

About

Runnerty module: AMQP Publisher

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages