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
|**'host'**| 'localhost' | Hostname or IP of the RabbitMQ Server |
37
-
|**'port'**| 5672 | Port the RabbitMQ Server runs on |
38
-
|**'virtualhost'**| '/' | RabbitMQ Virtual Host |
39
-
|**'exchange'**| 'amq.topic' | Exchange to work with on RabbitMQ |
40
-
|**'queuename'**| 'RabbitMQ' | Name of the Queue on RabbitMQ Server |
41
-
|**'username'**| 'guest' | RabbitMQ username |
42
-
|**'password'**| 'guest' | RabbitMQ password |
43
-
|**'routingkey'**| 'test-topic' | Routing key to subscribe to or poll on - only used for Consumer, when working with Producer the routing key is specified on a per message basis when publishing a message |
44
-
45
-
For example:
30
+
#### rabbitmq.ConnectorProperties class
31
+
32
+
**rabbitmq.ConnectorProperties** has various properties:
33
+
34
+
:host: Hostname or IP of the RabbitMQ Server.\
35
+
*Default:*`"localhost"`
36
+
:port: Port the RabbitMQ Server runs on.\
37
+
*Default:*`5672`
38
+
:virtualhost: RabbitMQ Virtual Host.\
39
+
*Default:*`"/"`
40
+
:exchange: Exchange to work with on RabbitMQ.\
41
+
*Default:* Default `rabbitmq.ExchangeProperties`
42
+
:queue: Queue to work with on RabbitMQ Server.\
43
+
*Default:* Default `rabbitmq.QueueProperties`
44
+
:credentials: RabbitMQ server credentials.\
45
+
*Default:* Default `rabbitmq.Credentials`
46
+
:routingkey: Routing key to subscribe to or poll on - only used for Consumer, when working with Producer the routing key is specified on a per message basis when publishing a message.\
47
+
*Default:*``"test-topic"``
48
+
49
+
Where, as can be seen, properties `exchange`, `queue` and `credentials` are
50
+
in turn other MATLAB classes:
51
+
52
+
**rabbitmq.ExchangeProperties**
53
+
54
+
:name: Name of the exchange.\
55
+
*Default:*`"amq.topic"`
56
+
:type: Type of exchange.\
57
+
*Default:*`"topic"`
58
+
:create: See [the note on create in MessageBroker](noteoncreate).\
59
+
*Default:*`true`
60
+
:durable: Only relevant if ``create`` = ``true``, create a durable exchange or not\
61
+
*Default:*`true`
62
+
:autoDelete: Only relevant if ``create`` = ``true``, create an autoDelete exchange or not\
63
+
*Default:*`false`
64
+
:internal: Only relevant if ``create`` = ``true``, create an internal exchange or not\
65
+
*Default:*`false`
66
+
:arguments: Only relevant if ``create`` = ``true``, allows setting additional arguments. Use the `put` method to add additional arguments. \
67
+
*Default:* Empty `HashMap`
68
+
69
+
**rabbitmq.QueueProperties**
70
+
71
+
:name: Name of the queue.\
72
+
*Default:*`"RabbitMQ"`
73
+
:create: See See [the note on create in MessageBroker](noteoncreate).\
74
+
*Default:*`true`
75
+
:durable: Only relevant if ``create`` = ``true``, create a durable queue or not.\
76
+
*Default:*`false`
77
+
:exclusive: Only relevant if ``create`` = ``true``, create an exclusive queue or not.\
78
+
*Default:*`false`
79
+
:autoDelete: Only relevant if ``create`` = ``true``, create an autoDelete queue or not.\
80
+
*Default:*`false`
81
+
:arguments: Only relevant if ``create`` = ``true``, allows setting additional arguments. Use the `put` method to add additional arguments. \
82
+
*Default:* Empty `HashMap`
83
+
84
+
**rabbitmq.Credentials**
85
+
86
+
:username: Username\
87
+
*Default:*`"guest"`
88
+
:password: Password\
89
+
*Default:*`"guest"`
90
+
91
+
Setting properties values can be done through traditional MATLAB class syntax:
46
92
47
93
```matlab
48
-
% Create a configuration with mostly default options but custom host and
durable: true # Work with a durable exchange or not
162
+
autoDelete: false # Work with an auto delete exchange or not
163
+
internal: false # Work with an internal exchange or not
164
+
arguments: # Set additional arguments, can be omitted entirely
165
+
alternate-exchange: my-ea # For example alternate-exchange
166
+
routingkey: test-topic # Routing key to subscribe to
167
+
```
168
+
169
+
```{note}
170
+
The `arguments` option can be omitted entirely for both `queue` and `exchange` if it is not necessary to set additional arguments. There is no fixed set of arguments which can be added and the entered argument names are not checked by the interface; they are passed on the server as-is. Check the RabbitMQ documentation to learn more about which exact arguments can be configured.
75
171
```
76
172
77
173
### RabbitMQ Producer for publishing messages `rabbitmq.Producer`
Copy file name to clipboardExpand all lines: Documentation/MessageBroker.md
+69-14Lines changed: 69 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ messages from a RabbitMQ Server which it then passes along as input to a
6
6
function deployed ot MATLAB Production Server. The MATLAB function is assumed to
7
7
have exactly one input which is the message as character array.
8
8
9
-
```mermaid
9
+
```{mermaid}
10
10
flowchart
11
11
client(Message Producer) -- publish message --> server[(RabbitMQ Server)]-- deliver message --> MessageBroker[MessageBroker] --"call with message as input"--> mps(MATLAB Production Server)
12
12
MessageBroker -. subscribe .-> server
@@ -26,7 +26,7 @@ used to parse the JSON string into a MATLAB structure.
26
26
## Dataflow
27
27
A full workflow with this package could look like the following:
28
28
29
-
```mermaid
29
+
```{mermaid}
30
30
sequenceDiagram
31
31
autonumber
32
32
participant MessageSender
@@ -75,11 +75,13 @@ sequenceDiagram
75
75
can use `rabbitmq.Producer` to send a message with the `routingkey` the
76
76
client is bound to, to the RabbitMQ Server.
77
77
78
-
> Note: this bypasses `MessageBroker`. `MessageBroker` does not do anything
79
-
> with the "MATLAB style output" of the function deployed to MATLAB
80
-
> Production Server. The MATLAB code deployed to MATLAB Production Server
81
-
> has to explicitly use `rabbitmq.Producer` in the MATLAB code if a reply is
82
-
> to be send over RabbitMQ.
78
+
```{note}
79
+
Note: this bypasses `MessageBroker`. `MessageBroker` does not do anything
80
+
with the "MATLAB style output" of the function deployed to MATLAB
81
+
Production Server. The MATLAB code deployed to MATLAB Production Server
82
+
has to explicitly use `rabbitmq.Producer` in the MATLAB code if a reply is
83
+
to be send over RabbitMQ.
84
+
```
83
85
84
86
7. If the `routingkey`, `queue` and `exchange` match the one the client has
85
87
subscribed to, the RabbitMQ server will deliver the reply to the client.
@@ -97,9 +99,11 @@ running correctly and can be accessed, for example by accessing the Web Admin
97
99
console which typically runs on port 15672, so for a local server check
98
100
http://localhost:15672/.
99
101
100
-
> Please see the [RabbitMQ Authentication, Authorization, Access Control
101
-
> documentation](https://www.rabbitmq.com/access-control.html) on how to
102
-
> configure credentials for remote access, TLS support, authentication, etc.
102
+
```{hint}
103
+
See the [RabbitMQ Authentication, Authorization, Access Control
104
+
documentation](https://www.rabbitmq.com/access-control.html) on how to
105
+
configure credentials for remote access, TLS support, authentication, etc.
106
+
```
103
107
104
108
2. For an initial test, MATLAB Compiler SDK's MATLAB Production Server testing
105
109
interface can be used rather than an actual MATLAB Production Server
@@ -112,7 +116,11 @@ http://localhost:15672/.
112
116
5. Click `Start` to start the test server.
113
117
114
118
3. Open `Software/Java/RabbitMQClient/src/main/resources/mps.yaml` and update
115
-
the options to match your configuration.
119
+
the options to match your configuration.
120
+
121
+
```{note}
122
+
The `arguments` for `queue` and `exchange` will likely have to be removed, they are not often used and shown here mainly for illustrative purposes to show *where* these can be added *if* they are needed. There is no fixed set of arguments which can be added and argument names are not verified by `MessageBroker`; they are send to the server as-is. Check the RabbitMQ documentation to learn more about the argument its supports.
123
+
```
116
124
117
125
```yaml
118
126
# MATLAB Production Server connection properties
@@ -130,17 +138,64 @@ the options to match your configuration.
130
138
131
139
# Messaging connection and routing properties
132
140
messageQueue:
133
-
queueName: RabbitMQ # Name of the Queue on RabbitMQ Server
141
+
queue:
142
+
name: RabbitMQ # Name of the Queue on RabbitMQ Server
% This document includes the root RELEASENOTES.md in the HTML version of the documentation. When viewing the Markdown version,please refer to [../RELEASENOTES.md](../RELEASENOTES.md)
0 commit comments