Documentation changes needed to support RTD
[ric-plt/lib/rmr.git] / docs / overview.rst
1  
2 .. This work is licensed under a Creative Commons Attribution 4.0 International License. 
3 .. SPDX-License-Identifier: CC-BY-4.0 
4 .. CAUTION: this document is generated from source in doc/src/rtd. 
5 .. To make changes edit the source and recompile the document. 
6 .. Do NOT make changes directly to .rst or .md files. 
7  
8  
9 RMR Overview 
10 ============================================================================================ 
11  
12  
13 RMr Library 
14 ============================================================================================ 
15  
16  
17 NAME 
18 -------------------------------------------------------------------------------------------- 
19  
20 RMr -- Ric Message Router Library 
21  
22 DESCRIPTION 
23 -------------------------------------------------------------------------------------------- 
24  
25 RMr is a library which provides a user application with the 
26 ability to send and receive messages to/from other RMr based 
27 applications without having to understand the underlying 
28 messaging transport environment (e.g. Nanomsg) and without 
29 needing to know which other endpoint applications are 
30 currently available and accepting messages. To do this, RMr 
31 depends on a routing table generated by an external source. 
32 This table is used to determine the destination endpoint of 
33 each message sent by mapping the message type T (supplied by 
34 the user application) to an endpoint entry. Once determined, 
35 the message is sent directly to the endpoint. The user 
36 application is unaware of which endpoint actually receives 
37 the message, and in some cases whether that message was sent 
38 to multiple applications. 
39  
40 RMr functions do provide for the ability to respond to the 
41 specific source instance of a message allowing for either a 
42 request response, or call response relationship when needed. 
43  
44 The Route Table 
45 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
46  
47 The library is supplied with a route table which maps message 
48 numbers to endpoint groups such that each time a message of 
49 type T is sent, the message is delivered to one member of 
50 each group associated with T. For example, message type 2 
51 might route to two different groups where group A consists of 
52 worker1 and worker2, while group B consists only of logger1. 
53  
54 It is the responsibility of the route table generator to know 
55 which endpoints belong to which groups, and which groups 
56 accept which message types. Once understood, the route table 
57 generator publishes a table that is ingested by RMr and used 
58 for mapping messages to end points. 
59  
60 Environment 
61 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
62  
63 To enable configuration of the library behaviour outside of 
64 direct user application control, RMr supports a number of 
65 environment variables which provide information to the 
66 library. The following is a list of the various environment 
67 variables, what they control and the defaults which RMr uses 
68 if undefined. 
69  
70  
71 RMR_ASYNC_CONN 
72    
73   Allows the asynch connection mode to be turned off (by 
74   setting the value to 0. When set to 1, or missing from the 
75   environment, RMR will invoke the connection interface in 
76   the transport mechanism using the non-blocking (asynch) 
77   mode. This will likely result in many "soft failures" 
78   (retry) until the connection is established, but allows 
79   the application to continue unimpeeded should the 
80   connection be slow to set up. 
81  
82 RMR_BIND_IF 
83    
84   This provides the interface that RMr will bind listen 
85   ports to allowing for a single interface to be used rather 
86   than listening across all interfaces. This should be the 
87   IP address assigned to the interface that RMr should 
88   listen on, and if not defined RMr will listen on all 
89   interfaces. 
90  
91 RMR_RTG_SVC 
92    
93   RMr opens a TCP listen socket using the port defined by 
94   this environment variable and expects that the route table 
95   generator process will connect to this port. If not 
96   supplied the port 4561 is used. 
97  
98 RMR_RTG_ISRAW 
99    
100   Is set to 1 if the route table generator is sending 
101   "plain" messages (not using RMr to send messages, 0 if the 
102   rtg is using RMr to send. The default is 1 as we don't 
103   expect the rtg to use RMr. 
104  
105 RMR_SEED_RT 
106    
107   This is used to supply a static route table which can be 
108   used for debugging, testing, or if no route table 
109   generator process is being used to supply the route table. 
110   If not defined, no static table is used and RMr will not 
111   report *ready* until a table is received. 
112  
113 RMR_SRC_ID 
114    
115   This is either the name or IP address which is placed into 
116   outbound messages as the message source. This will used 
117   when an RMR based application uses the rmr_rts_msg() 
118   function to return a response to the sender. If not 
119   supplied RMR will use the hostname which in some container 
120   environments might not be routable. 
121  
122 RMR_VCTL_FILE 
123    
124   This supplies the name of a verbosity control file. The 
125   core RMR functions do not produce messages unless there is 
126   a critical failure. However, the route table collection 
127   thread, not a part of the main message processing 
128   component, can write additional messages to standard 
129   error. If this variable is set, RMR will extract the 
130   verbosity level for these messages (0 is silent) from the 
131   first line of the file. Changes to the file are detected 
132   and thus the level can be changed dynamically, however RMR 
133   will only suss out this variable during initialisation, so 
134   it is impossible to enable verbosity after startup. 
135  
136 RMR_WARNINGS 
137    
138   If set to 1, RMR will write some warnings which are 
139   non-performance impacting. If the variable is not defined, 
140   or set to 0, RMR will not write these additional warnings. 
141  
142  
143 SEE ALSO 
144 -------------------------------------------------------------------------------------------- 
145  
146 rmr_alloc_msg(3), rmr_tralloc_msg(3), rmr_call(3), 
147 rmr_free_msg(3), rmr_init(3), rmr_init_trace(3), 
148 rmr_get_meid(3), rmr_get_src(3), rmr_get_srcip(3), 
149 rmr_get_trace(3), rmr_get_trlen(3), rmr_get_xact(3), 
150 rmr_payload_size(3), rmr_rcv_msg(3), rmr_rcv_specific(3), 
151 rmr_rts_msg(3), rmr_ready(3), rmr_fib(3), rmr_has_str(3), 
152 rmr_tokenise(3), rmr_mk_ring(3), rmr_realloc_payload(3), 
153 rmr_ring_free(3), rmr_set_trace(3), rmr_torcv_msg(3), 
154 rmr_wh_open(3), rmr_wh_send_msg(3)