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
When we create Seneca instance with pins that expose some functionalities to the outside world, Seneca tends to use internal communications before trying the actions declared in pins. As we have some special retrying policies set in transport (based on SQS queues), we would like Seneca to send message to the outside world, if it has particular listening pin exposed. Is it possible?
The code is as follows:
const seneca = require('seneca')({});
seneca
.use('./plugin')
.use('./another-plugin')
.client({
type: 'sqs',
/** Our transport settings here **/
pin: 'role: plugin, cmd: *'
})
.client({
type: 'sqs',
/** Our transport settings here **/
pin: 'role: another-plugin, cmd: *'
});
seneca.ready(error => {
if (error) return;
if (process.env.LISTEN_HOST) {
seneca.listen({
host: process.env.LISTEN_HOST,
port: process.env.LISTEN_PORT
});
}
if (process.env.QUEUE_URL) {
seneca.listen({
type: 'sqs',
/** Our transport settings here **/
});
}
});
So, based on examples above, scenario is as follows:
Some external microservice calls action on plugin
Plugin calls Seneca action on another-plugin
another-plugin starts executing action immediately, as it's called internally
If another-plugin fails, it returns error immediately to plugin
What we would want to achieve, is to call Seneca action over our transport between 2 and 3 step if pins that are needed for fulfilling the action are exposed by any client command. Is it possible?
We use Seneca 2.1.
The text was updated successfully, but these errors were encountered:
SzybkiSasza
changed the title
Seneca is using internal communications before the one declared in pins.
Seneca is using internal communications before the action declared in pins.
Sep 16, 2016
When we create Seneca instance with pins that expose some functionalities to the outside world, Seneca tends to use internal communications before trying the actions declared in pins. As we have some special retrying policies set in transport (based on SQS queues), we would like Seneca to send message to the outside world, if it has particular listening pin exposed. Is it possible?
The code is as follows:
And exposed roles are as follows:
So, based on examples above, scenario is as follows:
plugin
another-plugin
another-plugin
starts executing action immediately, as it's called internallyanother-plugin
fails, it returns error immediately toplugin
What we would want to achieve, is to call Seneca action over our transport between 2 and 3 step if pins that are needed for fulfilling the action are exposed by any
client
command. Is it possible?We use Seneca 2.1.
The text was updated successfully, but these errors were encountered: