Skip to content

Commit fca0406

Browse files
authored
Usage docs
1 parent e39af89 commit fca0406

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,33 @@ Ensemble adapter for RabbitMQ
2525
## Development
2626
2727
Development is done on [Cache-Tort-Git UDL fork](https://github.com/MakarovS96/cache-tort-git)
28+
29+
## Use
30+
31+
Check `RabbitMQ.Utils` for sample code. The main class is `isc.rabbitmq.API`. It has the following methods.
32+
33+
| Method | Arguments | Returns | Description |
34+
|--------------------|-----------------------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------|
35+
| %OnNew | host, port, user, pass, virtualHost, queue, durable | api | Creates new connection to RabbitMQ |
36+
| sendMessage | msg, correlationId, messageId | null | Sends message to default queue (as specified in %OnNew) |
37+
| sendMessageToQueue | queue, msg, correlationId, messageId | null | Sends message to the specified queue |
38+
| readMessageString | - | result | Reads message from default queue. Returns list of message properties (including message text) |
39+
| readMessageStream | result | msg | Reads message from default queue. Returns message text as array and result - is populated with a list of message properties |
40+
| close | - | - | Closes the connection |
41+
42+
Arguments:
43+
44+
| Argument | Java type | InterSystems type | Value | Required | Description |
45+
|---------------|------------------|---------------------|---------------|-----------------------------------------------|-----------------------------------------|
46+
| host | String | %String | localhost | Yes | Address of RabbitMQ server |
47+
| port | int | %Integer | -1 | Yes | RabbitMQ listener port |
48+
| user | String | %String | guest | Yes | Username |
49+
| pass | String | %String | guest | Yes | Password |
50+
| virtualHost | String | %String | / | Yes | Virtual host |
51+
| queue | String | %String | Test | Yes | Queue name |
52+
| durable | int | %Integer | 1 | Required only if you want to create new queue | The queue will survive a server restart |
53+
| msg | byte[] | %GlobalBinaryStream | Text | Yes as argument | Message body |
54+
| correlationId | String | %String | CorrelationId | Required only with messageId | Correlation identifier |
55+
| messageId | String | %String | MessageId | Required only with correlationId | Message identifier |
56+
| result | String[] | %ListOfDataTypes | - | Yes as argument. Should have 16 elements | List of message properties |
57+
| api | isc.rabbitmq.API | isc.rabbitmq.API | - | - | API object |

0 commit comments

Comments
 (0)