Queue Outgoing Plugin
The queue outgoing plugin publishes messages to an external queue accessed from the outside via the Queue API in 1Gateway.
Configuration Fields
Generic Configuration Fields:
| Field name | Value | Description |
|---|---|---|
| Topics | Queue Topic | Defines which messages should go on the sender plugin queue. The format is: ´origin_endpoint.message_type.phase. |
| Queue Name | Any string | Name of the queue used to process the messages for a specific sender plugin. This queue name is internal and should not be accessed through the API. |
Specific Queue Sender Configuration Fields:
The messages that get to the plugin go through the configured mapper before being published into the external queue. If a mapper is configured, the topic for the outgoing queue should be the message type after the mapper transformations.
| Field name | Value | Description |
|---|---|---|
| Topics for Outgoing Queue | Queue Topic | Defines which messages should go on the sender plugin queue. The format is: origin_endpoint.message_type.phase. |
| Outgoing Queue Name | Any string | Name of the queue where messages get published after being processed by the plugin and mapper. This queue is accessed through the API. |
Accessing Messages from the API
To query a single message from the external API:
GET /api/v4/message/queue/<Outgoing queue name>
To query messages in bulk:
GET /api/v4/message/queue/bulk/<Outgoing queue name>
| Name | Description |
|---|---|
| num | Number of messages (minimum 1) |
| integer | Default value : 1 |
| ack | If true, the messages are removed from the queue (default true) |
| boolean | Default value : true |
| includeHeaders | If true, includes message headers in the response (default false) |
| boolean | Default value : false |
For more information, go to <1gateway-url>/swagger-ui/index.html
Functionality
-
Messages that go through the plugin are written to the audit log.
-
Mapper transformations can be applied before publishing the message to the external queue.
-
The endpoint in the message headers in the external queue is the queue sender plugin endpoint.
How to test
- Configure a listener plugin that generates messages to be consumed by the Queue sender plugin
- Generates messages of type “NormalizedAlarm”
- Configure Queue sender plugin
- Internal queue
- Queue name: internal
- Topic: ..NormalizedAlarm
- External queue
- Queue name: custom
- Topic: ..Custom
- Call QUEUE API to GET the messages from the external queue
- Check that you get a message of type “Custom”