Categories:
directline-auraline-processor plugin
Technical description of directline-auraline-processor plugin
Introduction
This plugin receives requests from aura-groot and send them to Auraline callback.
Consumes components (IOC)
| Name | Type | Description |
|---|---|---|
| auralineClient | PluginType.Service | Auraline client |
| configurationManager | PluginType.Service | Configuration manager |
| directlineService | PluginType.Service | Services and utilities for Directline channel |
Provides components (IOC)
| Name | Type | Description |
|---|---|---|
| directlineAuralineProcessor | PluginType.Processor | Manage Auraline responses |
auraline-directline-processor flow definition
To process a message, the auraline-directline-processor uses AuraBridgeFlow with the following definition:
const flow: BridgeFlow = {
name: 'directlineToAuralineFlow',
source: {
type: BridgeNodeType.Directline
},
destination: {
type: BridgeNodeType.Auraline,
converter: DirectlineToAuralineConverter,
client: services.auralineClient,
clientOptions: { queue: { bridgeFlowName: directlineToAuralineFlow.name } }
},
onError: {
destinations: [
{
type: BridgeNodeType.Auraline,
converter: ErrorToAuralineApiConverter,
client: services.auralineClient,
decode: AuralineDestinationResponseError
}
]
}
};
According to the flow definition, AuraBridgeFlow tries to process, convert and send (using queues) the message to the
Auraline callback endpoint defined in the callbackOptions channel configuration property, within the ResponseOptions model.
If some type of error occurs during this process and is marked as recoverable, certain retries will be executed. If after all, the error continues, an error message will be sent to the endpoint.
AuralineToDirectlineConverter
Main converter, in charge of transforming DirectLine activities to Auraline format. The response messages will have the following format:
{
"activities": [
{
"type": "message",
"serviceUrl": "http://aura-bridge-outbound:8045/aura-services/auraline",
"channelId": "c71dc728-5fe2-4735-927d-0c419b35ec59",
"conversation": {
"id": "4nc3u4hn"
},
"recipient": {
"id": "user1"
},
"text": "Hi!",
"inputHint": "acceptingInput",
"channelData": {
"hasMoreMessages": false,
"correlator": "53c42d06-3be1-48c4-a6c9-afa6e76d54fc"
},
"replyToId": "8vvicc88",
"id": "8vvicc88|0001"
}
],
"correlator": "53c42d06-3be1-48c4-a6c9-afa6e76d54fc",
"timestamp": "2023-11-08T12:24:36.420Z",
"id": "8vvicc88",
"to": "user1",
"conversationId": "4nc3u4hn"
}
Inside the activities array, all activities will have a unique identifier (messageId|XXXX) that the client should store to
later send the ack to Auraline.