Browse code

modules: readme files regenerated - nats ... [skip ci]

Kamailio Dev authored on 07/01/2022 13:31:10
Showing 1 changed files
... ...
@@ -14,9 +14,9 @@ Emmanuel Schmidbauer
14 14
 
15 15
    <eschmidbauer@gmail.com>
16 16
 
17
-   Copyright � 2021 Voxcom Inc
17
+   Copyright © 2021 Voxcom Inc
18 18
 
19
-   Copyright � 2021 VOXO
19
+   Copyright © 2021 VOXO
20 20
      __________________________________________________________________
21 21
 
22 22
    Table of Contents
... ...
@@ -33,17 +33,24 @@ Emmanuel Schmidbauer
33 33
         4. Parameters
34 34
 
35 35
               4.1. nats_url (str)
36
-              4.2. subject_queue_group (str)
36
+              4.2. num_publish_workers (int)
37
+              4.3. subject_queue_group (str)
37 38
 
38
-        5. Pseudo Variables
39
-        6. Event Routes
39
+        5. Functions
40
+
41
+              5.1. nats_publish(subject, payload)
42
+
43
+        6. Pseudo Variables
44
+        7. Event Routes
40 45
 
41 46
    List of Examples
42 47
 
43 48
    1.1. Set nats_url parameter
44
-   1.2. Set subject_queue_group parameter
45
-   1.3. Example usage of $natsData pseudo variable
46
-   1.4. Define the event routes
49
+   1.2. Set num_publish_workers parameter
50
+   1.3. Set subject_queue_group parameter
51
+   1.4. nats_publish usage
52
+   1.5. Example usage of $natsData pseudo variable
53
+   1.6. Define the event routes
47 54
 
48 55
 Chapter 1. Admin Guide
49 56
 
... ...
@@ -59,10 +66,15 @@ Chapter 1. Admin Guide
59 66
    4. Parameters
60 67
 
61 68
         4.1. nats_url (str)
62
-        4.2. subject_queue_group (str)
69
+        4.2. num_publish_workers (int)
70
+        4.3. subject_queue_group (str)
71
+
72
+   5. Functions
63 73
 
64
-   5. Pseudo Variables
65
-   6. Event Routes
74
+        5.1. nats_publish(subject, payload)
75
+
76
+   6. Pseudo Variables
77
+   7. Event Routes
66 78
 
67 79
 1. Overview
68 80
 
... ...
@@ -101,9 +113,10 @@ Chapter 1. Admin Guide
101 113
 4. Parameters
102 114
 
103 115
    4.1. nats_url (str)
104
-   4.2. subject_queue_group (str)
116
+   4.2. num_publish_workers (int)
117
+   4.3. subject_queue_group (str)
105 118
 
106
-4.1. nats_url (str)
119
+4.1.  nats_url (str)
107 120
 
108 121
    The nats url.
109 122
 
... ...
@@ -111,14 +124,27 @@ Chapter 1. Admin Guide
111 124
 
112 125
    Default value is nats://127.0.0.1:4222
113 126
 
114
-   Example 1.1. Set nats_url parameter
127
+   Example 1.1.  Set nats_url parameter
115 128
 ...
116 129
 modparam("nats", "nats_url", "nats://127.0.0.1:4222")
117 130
 modparam("nats", "nats_url", "nats://user1:pass1127.0.1.2:4222") // with auth
118 131
 modparam("nats", "nats_url", "nats://127.1.2.3:4222")
119 132
 ...
120 133
 
121
-4.2. subject_queue_group (str)
134
+4.2.  num_publish_workers (int)
135
+
136
+   The number of worker threads for publishing messages.
137
+
138
+   Usage: nats related.
139
+
140
+   Default value is “2”.
141
+
142
+   Example 1.2.  Set num_publish_workers parameter
143
+...
144
+modparam("nats", "num_publish_workers", 4)
145
+...
146
+
147
+4.3.  subject_queue_group (str)
122 148
 
123 149
    The NATS Subject and Queue Group. Separated by ":"
124 150
 
... ...
@@ -126,7 +152,7 @@ modparam("nats", "nats_url", "nats://127.1.2.3:4222")
126 152
 
127 153
    Default value is not set.
128 154
 
129
-   Example 1.2. Set subject_queue_group parameter
155
+   Example 1.3.  Set subject_queue_group parameter
130 156
 ...
131 157
 modparam("nats", "subject_queue_group", "Kamailio-World:2020")
132 158
 modparam("nats", "subject_queue_group", "Kamailio-World:2021") // this will crea
... ...
@@ -135,22 +161,37 @@ modparam("nats", "subject_queue_group", "MyQueue1:2021")
135 161
 modparam("nats", "subject_queue_group", "MyQueue2:2021")
136 162
 ...
137 163
 
138
-5. Pseudo Variables
164
+5. Functions
165
+
166
+   5.1. nats_publish(subject, payload)
167
+
168
+5.1.  nats_publish(subject, payload)
169
+
170
+   Publishes the payload to subject.
171
+
172
+   Example 1.4.  nats_publish usage
173
+...
174
+$var(my_info) = "$ci=" + $ci + " $fU=" + $fU;
175
+nats_publish("mysubject", "$var(my_info)"); # publish $var(my_info) to "mysubjec
176
+t"
177
+...
178
+
179
+6. Pseudo Variables
139 180
 
140
-   Example 1.3. Example usage of $natsData pseudo variable
181
+   Example 1.5. Example usage of $natsData pseudo variable
141 182
         ...
142 183
         xlog("L_INFO", "received payload $natsData");
143 184
 }
144 185
 
145 186
      * $natsData Contains the payload of a consumed message
146 187
 
147
-6. Event Routes
188
+7. Event Routes
148 189
 
149 190
    The worker process issues an event-route where we can act on the
150 191
    received payload. The name of the event-route name must match the
151 192
    subject of the message.
152 193
 
153
-   Example 1.4. Define the event routes
194
+   Example 1.6. Define the event routes
154 195
 ...
155 196
 modparam("nats", "subject_queue_group", "Kamailio-World:2021")
156 197
 modparam("nats", "subject_queue_group", "MyQueue1:2021")