...
With an AMQP Hook, messages are sent to a configured messaging system using Advanced Message Queuing Protocol 1.0 (AMPQ). Where and when these messages are sent is defined in the System Hook configuration. Any changes to the System Hook configuration will not apply until the affected services have been restarted.
The AMQP Hooks allow for asynchronous reactions to events like object creation, update or deletion. There are different types of AMQP Hooks available, each of them specialized for selected function calls. The messages contain the properties of the object which metadata which is the target of the function call triggering the AMQP Hook. The action code is included in there in the message as well as the history code that is added to the audit trail. The AMQP Hook can be triggered by any endpoint that induced the characteristic history codes of the AMQP Hook kann ich das irgendwo in der Endpunktdoku dann erkennen?.
AMQP Hook Configuration
Parameters
The AMQP configuration is located in the amqp
key under the systemhooks
top-level key. It is represented as a list of one or more System Hooks whose parameters are described in the table below:
Parameter | Type | Description |
---|
enable | boolean |
Is is this configuration active/enabled |
?Condition condition that specifies when the system hook is used |
. Supported (SpEL und and Javascript. |
type | string |
Defines defines the processing step for which the system hook is to be used |
. |
url | string | AMQP server endpoint, e.g. 127.0.0.1:5672 |
.Username username for the AMQP server |
.Password password for the AMQP server |
.Name name of the queue to which the messages are written |
.Maximum maximum bulk size for a message |
.Example Configuration
The parameters of the AMQP Hook are specified in JSON format. In the configuration file ich würde den hier auch noch mal nennen, multiple AMQP Hooks can be defined in a list called amqp
. It must however be observed that only one messaging queue can be used. The messaging queue specified for the first defined AMQP Hook will apply to all following AMQP Hook definitions as well. Of course, the messaging system needs to support AMQP 1.0. Any changes to the AMQP Hook configuration require a restart of the API Gateway-gateway service.
The example code below configures an AMQP Hook triggered by a document import. This configuration has exactly one System Hook, which is an AMQP Hook of the type object.insert.document
. If the evaluation of the predicate
for a document on import results is true
(in our example only for compound documents), the API-Gateway gateway service sends a message with the metadata of the document to the defined messaging system. In addition, the configuration specifies a bulkSize
of 10, i.e. for a batch import of 100 documents matching the predicate
, 10 messages with 10 metadata entries per message are written to the queue named lc.textextraction
.
...
In our example of asynchronous full-text indexing, the API-Gateway gateway service is responsible for evaluating the system hook. To apply the configuration, the API-Gateway gateway service must be restarted after saving the configuration file. Messages will then be send to the messaging system for haben wir hier was zur Installation for the import of compound documents.
...
Summary
In this article, we gave an introduction to AMQP Hooks, covered the AMQP Hook configuration using the example of asynchronous full text indexing . The and provide a list of all AMQP Hooks available. Check out Webhooks which are the second type of System Hooks in yuuvis® Momentum is the Webhook.
Info |
---|
|
Read on
Section |
---|
Column |
---|
| Insert excerpt |
---|
| System Hooks |
---|
| System Hooks |
---|
nopanel | true |
---|
| Keep reading
|
Column |
---|
| Insert excerpt |
---|
| Webhooks |
---|
| Webhooks |
---|
nopanel | true |
---|
| Keep reading
|
|
|